Samsung Electronics Interview Question

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