Pocket Gems interview question

Top K elements in array