Find anagrams in a group of words
words are said to be anagrams of each other if they are made up of
we have an array of words, then we want to group the words of one
input array is [“ram”, “pot”, “mar”,
output array should be [“ram”, “mar”, “arm”,
simple solution for this is to sort each word and put in a hash-map.
solution is to sort each word and put in a trie.
while putting in hash-map or trie, the word already exists, then the
new word is an anagram of the existing word and should be grouped
together with it.