Problem
LeetCode 49: Group Anagrams
Solution
| |
Explaination
We loop over list of strings. Sort string and use as key for our dict to group anagrams
References
Also see
- Concatenation of Array
- Contains Duplicate
- Valid Anagram
- Two Sum
- Longest Common Prefix
- Remove Element
- Majority Element
- Design HashSet
- Design HashMap
- Sort an Array
- Sort Colors
- Top K Frequent Elements
- Encode and Decode Strings
- Range Sum Query 2D Immutable
- Product of Array Except Self
- Valid Sudoku
- Longest Consecutive Sequence
- Best Time to Buy And Sell Stock II
- Majority Element II
- Subarray Sum Equals K
- First Missing Positive