5-line Python solution, easy to understand
\nfrom collections import defaultdict\n\nclass Solution:\n    def groupAnagrams(self, strs: List[str]) -> List[List[str]]:\n        letters_to_words = defaultdi
```\nfrom collections import defaultdict\n\nclass Solution:\n    def groupAnagrams(self, strs: List[str]) -> List[List[str]]:\n        letters_to_words = defaultdict(list)\n        for word in strs:\n            letters_to_words[tuple(sorted(word))].append(word)\n        return list(letters_to_words.values())\n```\n
['Python']