You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def find_diff(self, str1, str2):
if str1 is None or str2 is None:
raise TypeError('str1 or str2 cannot be None')
seen = {}
for char in str1:
if char in seen:
seen[char] += 1
else:
seen[char] = 1
for char in str2:
try:
seen[char] -= 1
except KeyError:
return char
if seen[char] < 0:
return char
for char, count in seen.items():
return char
`
Fails for input Solution().find_diff('bbaabbc', 'aabbbb')
Last for loop should be
`
for char, count in seen.items():
if count:
return char
`
The text was updated successfully, but these errors were encountered:
`
class Solution(object):
`
Fails for input
Solution().find_diff('bbaabbc', 'aabbbb')
Last for loop should be
`
for char, count in seen.items():
`
The text was updated successfully, but these errors were encountered: