Question d’entretien chez Samsung Electronics

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