Given list of strings, print all anagrams together

O(M + N logN) where M is max chars in one word and N is number of
strings in the list