Skip to content
CodeItRaw
Code Reading
/
Anagram?
Path
Play
Daily
Leaderboard
tr
Bug Hunt
Anagram?
It should be True for "listen" and "silent", but it is always False. Find the line and the kind of bug.
Click the line you think is wrong.
1
def
is_anagram
(a, b):
2
counts = {}
3
for
ch
in
a:
4
counts[ch] = counts.get(ch,
0
) +
1
5
for
ch
in
b:
6
counts[ch] = counts.get(ch,
0
) +
1
7
return
all(v ==
0
for
v
in
counts.values())