Domanda di colloquio di Samsung Electronics

One coding ques, To group words with the same anagrams.