Pocket Gems interview question

Prepare stuff on the big O complexity .