We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ae36ba commit ded9dccCopy full SHA for ded9dcc
group-anagrams/mandel-17.py
@@ -0,0 +1,10 @@
1
+import collections
2
+from typing import List
3
+
4
+class Solution:
5
+ def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
6
+ result = collections.defaultdict(list)
7
+ for s in strs:
8
+ result[''.join(sorted(s))].append(s)
9
+ return list(result.values())
10
0 commit comments