Problem
Given a list of words strs, put words that are anagrams of each other (same letters, same counts) into the same group. Return the list of groups. The order of the groups, and the order inside each group, does not matter.
Example 1
["eat", "tea", "tan", "ate", "nat", "bat"]
Example 2
→ [["eat", "tea", "ate"], ["tan", "nat"], ["bat"]]
Example 3
- Input
- [""]
- Output
- [[""]]
Example 4
- Input
- ["a"]
- Output
- [["a"]]
Constraints
0 <= strs.length <= 10^40 <= strs[i].length <= 100strs[i] contains only lowercase English letters.