Pocket Gems interview question

Coding challenge