summaryrefslogtreecommitdiff
path: root/1_array_hashing/group_anagram.py
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2024-08-25 01:01:55 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2024-08-25 01:01:55 +0900
commit6666388bbfc5f66756464151ff894a76a25c4ebb (patch)
treee9b85c5dbbf0efa00780d8c3df8ee2752bc8cfa5 /1_array_hashing/group_anagram.py
parentb6855458c3c74ee93496275ea97bc3ba97a31e07 (diff)
Init
Diffstat (limited to '1_array_hashing/group_anagram.py')
-rw-r--r--1_array_hashing/group_anagram.py8
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)