Pocket Gems Interview Question

1. finding substring, k most frequent items