Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def magic(s1,s2):
- m1 = {i:s1.count(i) for i in set(s1)}
- m2 = {i:s2.count(i) for i in set(s2)}
- for i in m2.keys():
- if not i in m1.keys() and m2[i]!=m1[i]:
- return False
- return True
- print(magic("мошкара","ромашка"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement