Pocket Gems interview question

string and kth from a array. Just like other questions.