diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2024-08-26 13:16:16 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2024-08-26 13:16:16 +0900 |
| commit | a1b80e66b43ed77c34357af31686697322421995 (patch) | |
| tree | 204b0d74f6a55177a9d568d73b43e54af02f5206 /1_array_hashing | |
| parent | 882c33223fab4b04695fcdaae958935fa62505c3 (diff) | |
Init
Diffstat (limited to '1_array_hashing')
| -rw-r--r-- | 1_array_hashing/group_anagram.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/1_array_hashing/group_anagram.py b/1_array_hashing/group_anagram.py index b4c788f..2276799 100644 --- a/1_array_hashing/group_anagram.py +++ b/1_array_hashing/group_anagram.py @@ -33,14 +33,14 @@ Constraints: """ from collections import defaultdict -from typing import List +from typing import Dict, List class Solution: def dictionary(self, strs: List[str]) -> List[List[str]]: - res: dict = defaultdict(list) + res: Dict = defaultdict(list) for s in strs: - count = [0] * 26 + count: List[int] = [0] * 26 for c in s: count[ord(c) - ord("a")] += 1 res[tuple(count)].append(s) |
