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
My initial attempt to solve this challenge is below:
from collections import Counter
class Solution(object):
def find_diff(self, str1, str2):
if str1 is None or str2 is None:
return TypeError("Strings were not provided")
c1 = Counter(str1)
c2 = Counter(str2)
if len(c1) > len(c2):
for item in c1.items():
if item not in c2.items():
return item[0]
else:
for item in c2.items():
if item not in c1.items():
return item[0]
If I manually create the class and test the method I get the correct response for the following assertions (they fail in test cell - not sure why yet):
Was this because of the find_diff_xor method? I noticed it never mentioned it in the challenge overview, but it still checked for it. I deleted it because there also wasn't a placeholder in the code block for it, so I'm assuming it was kept in by mistake? I just cloned the repo, so I'm trying to make sure I didn't do the challenge wrong.
My initial attempt to solve this challenge is below:
If I manually create the class and test the method I get the correct response for the following assertions (they fail in test cell - not sure why yet):
A few examples of return values:
The text was updated successfully, but these errors were encountered: