Group Anagrams
MediumAcceptance Rate 66.8%
Given an array of strings
strs, group the anagrams together.Examples
Example 1
Input
strs = ["eat","tea","tan","ate","nat","bat"]
Output
[["bat"],["nat","tan"],["ate","eat","tea"]]
Constraints
1 <= strs.length <= 10^40 <= strs[i].length <= 100strs[i] consists of lower-case English letters.