We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 13083db commit 57b41adCopy full SHA for 57b41ad
.vscode/settings.json
@@ -14,5 +14,6 @@
14
},
15
"python.testing.pytestArgs": ["solutions"],
16
"python.testing.unittestEnabled": false,
17
- "python.testing.pytestEnabled": true
+ "python.testing.pytestEnabled": true,
18
+ "ruff.lint.select": ["F401"]
19
}
solutions/solution_0049/__init__.py
@@ -1,12 +1,11 @@
1
import collections
2
-from typing import List
3
4
5
class Solution:
6
- def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
+ def groupAnagrams(self, strs: list[str]) -> list[list[str]]:
7
anagrams = collections.defaultdict(list)
8
9
for word in strs:
10
- anagrams["".join(sorted(word))].append(word)
+ anagrams[''.join(sorted(word))].append(word)
11
12
return list(anagrams.values())
0 commit comments