This question evaluates string-processing and data-structuring competency, focusing on identifying and grouping anagrams through comparison of unordered character multisets.
Given an array of strings, group the strings into lists such that each list contains strings that are anagrams of each other.
Two strings are anagrams if they contain the same characters with the same frequencies (order does not matter).
strs
: an array of strings (assume lowercase English letters).
Input: [ "eat", "tea", "tan", "ate", "nat", "bat" ]
Output (one valid answer): [ ["eat","tea","ate"], ["tan","nat"], ["bat"] ]
1 <= len(strs) <= 10^4
0 <= len(strs[i]) <= 100
<= 10^6