# Time: O(N) # Space: O(N) from collections import Counter class Solution: def isAnagram(self, s: str, t: str) -> bool: return Counter(s) == Counter(t)