Samsung Electronics interview question

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