DEV Community

Alexander Kazanski
Alexander Kazanski

Posted on

Sorting each word gives you a canonical key — two words with the same key are anagrams. This one-pass hash map groups them all in O(n·k).

Top comments (0)