Return top 10 most used words in a string
Anonymous
Go through every word, and put the count of each word in a hashmap. That will be O(n). Then for every key in the Hashmap you get it's count and you can use different sorting algorithms to determine the order. (for example you could put everything into a heap, binary search tree, use bin sort, or use insertion sort which works fast for streaming input).
Check out your Company Bowl for anonymous work chats.