Skip to content

Commit e0d729a

Browse files
committed
Format using black
1 parent e03738d commit e0d729a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Neetcode/Neetcode_150/Group_Anagrams/Group_Anagrams.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
44

55
# # Step 1
66
# anagrams = defaultdict(list) # Initialize a dictionary to hold lists of anagrams
7-
7+
88
# # Iterate over each word in the list
99
# for word in strs:
1010
# # Sort the characters of the word to use as the key
1111
# sorted_word = ''.join(sorted(word))
1212
# # Group anagrams together using the sorted word as the key
1313
# anagrams[sorted_word].append(word)
14-
14+
1515
# # Convert the dictionary values (which are lists of anagrams) to a list of lists
1616
# return list(anagrams.values())
1717

@@ -35,14 +35,14 @@ def groupAnagrams(self, strs):
3535
"""
3636
# # Step 1
3737
# anagrams = defaultdict(list) # Initialize a dictionary to hold lists of anagrams
38-
38+
3939
# # Iterate over each word in the list
4040
# for word in strs:
4141
# # Sort the characters of the word to use as the key
4242
# sorted_word = ''.join(sorted(word))
4343
# # Group anagrams together using the sorted word as the key
4444
# anagrams[sorted_word].append(word)
45-
45+
4646
# # Convert the dictionary values (which are lists of anagrams) to a list of lists
4747
# return list(anagrams.values())
4848

@@ -55,4 +55,3 @@ def groupAnagrams(self, strs):
5555
count[ord(c) - ord("a")] += 1
5656
ans[tuple(count)].append(s)
5757
return ans.values()
58-

0 commit comments

Comments
 (0)