49. Group Anagrams
Practice Group Anagrams for free on NudgeCode: Medium, Array & Hash Table pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.
Two words are anagrams if one is a rearrangement of the other's letters. Split strs into groups so that each group holds exactly the words that are anagrams of each other. The groups, and the words inside each group, can be in any order.
Example
strs = ["eat","tea","tan","ate","nat","bat"] -> [["bat"],["nat","tan"],["ate","eat","tea"]]
Constraints
- 1 <= strs.length <= 10^4
- 0 <= strs[i].length <= 100
strs[i]contains only lowercase English letters