Skip to content

Commit 950a5c3

Browse files
Update anagrams.py
1 parent 4cf4204 commit 950a5c3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

strings/anagrams.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def signature(word: str) -> str:
1717
'a1e1f1i1l1n1s1t2'
1818
"""
1919
frequencies = collections.Counter(word)
20-
return "".join(f"{char}{frequencies[char]}" for char in sorted(frequencies))
20+
return "".join(f"{char}{frequency}" for char, frequency in sorted(frequencies.items()))
2121

2222

2323
def anagram(my_word: str) -> list[str]:

0 commit comments

Comments
 (0)