From 6666388bbfc5f66756464151ff894a76a25c4ebb Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Sun, 25 Aug 2024 01:01:55 +0900 Subject: Init --- 1_array_hashing/group_anagram.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to '1_array_hashing/group_anagram.py') 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) -- cgit v1.2.3