Pocket Gems Interview Question

Top K most frequent numbers in a array. Follow-up, in a stream. Implement strStr().