Pocket Gems interview question

array based question