Shipsy interview question

Basic Array and string problems