loading…
Write group_anagrams(words) that groups words that are anagrams of each other. Return a list of groups; the order of groups and of words inside a group does not matter.
group_anagrams(["eat", "tea", "tan", "ate", "nat", "bat"])
-> [["eat", "tea", "ate"], ["tan", "nat"], ["bat"]]
Stuck on the idea itself? The arrays & hashing lesson walks through the pattern from scratch.