Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def isAnagram(self, s: str, t: str) -> bool:
- s_dict = defaultdict(int)
- for c in s:
- s_dict[c] += 1
- t_dict = defaultdict(int)
- for c in t:
- t_dict[c] += 1
- return s_dict == t_dict
Advertisement
Add Comment
Please, Sign In to add comment