Pocket Gems interview question

Coding question