Skip to content

Latest commit

 

History

History
executable file
·
10 lines (5 loc) · 382 Bytes

File metadata and controls

executable file
·
10 lines (5 loc) · 382 Bytes

49. Group Anagrams

In this problem, we hope to classify the same words combinations into the same gropus.

I map to the same string into the same index. I shall use Trie.

I search in the Internet and find a genius datastructure——unordered_map.

We can use bucket to compute the number of each char. And use this bucket a1b2c3 as the key and a list as the value. Accept!