Pocket Gems interview question

implement strstr and find most k frequent numbers in an array