Back to exercises

Group Anagrams

Use a dictionary keyed by the sorted characters of each word, then append each word into the matching bucket.

Coding Exercises Medium O(n * k log k)

Group Anagrams

Use a dictionary keyed by the sorted characters of each word, then append each word into the matching bucket.

Group words that are anagrams of each other and return the grouped lists.