Python - Clean with Dictionary
\n\ndef groupAnagrams(self, strs: List[str]) -> List[List[str]]:\n        anagrams = {}\n        for word in strs:\n            sortedWord = "".join(sorted(word
\n```\ndef groupAnagrams(self, strs: List[str]) -> List[List[str]]:\n        anagrams = {}\n        for word in strs:\n            sortedWord = "".join(sorted(word))\n            if sortedWord in anagrams:\n                anagrams[sortedWord].append(word)\n            else:\n                anagrams[sortedWord] = [word]\n        return list(anagrams.values())\n```
['Python']