← 返回 amazon 的题目列表Group Anagrams by Frequency
类型:online_judge
amazon
Given a list of words, group them by the frequency of characters in each word, returning a list of these groups. Words with the same character frequencies belong to the same group. All words in the input are composed of lowercase letters and contain no symbols.
Example:
Input: ['eat', 'tea', 'tan', 'ate', 'nat', 'bat'] Output: [['eat', 'tea', 'ate'], ['tan', 'nat'], ['bat']]
Input: ['a', 'b', 'c', 'a'] Output: [['a', 'a'], ['b'], ['c']]
Example
Input
['eat', 'tea', 'tan', 'ate', 'nat', 'bat']