Array
49. Group Anagrams
Two words are anagrams iff sorting their letters produces the same string — so that sorted string is a canonical key, identical for every member of a group. Drop each word into a hash map keyed by…
Loading…
Two words are anagrams iff sorting their letters produces the same string — so that sorted string is a canonical key, identical for every member of a group. Drop each word into a hash map keyed by…
Loading…