diff options
Diffstat (limited to '1_array_hashing/group_anagram.py')
| -rw-r--r-- | 1_array_hashing/group_anagram.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/1_array_hashing/group_anagram.py b/1_array_hashing/group_anagram.py index f302afa..35b09ae 100644 --- a/1_array_hashing/group_anagram.py +++ b/1_array_hashing/group_anagram.py @@ -38,7 +38,7 @@ from typing import List class Solution: def dictionary(self, strs: List[str]) -> List[List[str]]: - res = defaultdict(List) + res = defaultdict(list) for s in strs: count = [0] * 26 for c in s: @@ -62,8 +62,12 @@ Solution url: https://neetcode.io/problems/anagram-groups video: https://youtu.be/vzdNOK2oB2E + +1. dictionary +time: +space: code: -```dictionary +```python class Solution: def groupAnagrams(self, strs: List[str]) -> List[List[str]]: ans = defaultdict(list) |
