Pocket Gems interview question

They required a hackerrank test.