class Solution:
    def isAnagram(self, s: str, t: str) -> bool:
        hmaps = dict()
        for c in s:
            hmaps[c] = hmaps.get(c, 0) + 1
        
        for c in t:
            if c not in hmaps:
                return False
            hmaps[c] -=1
            if hmaps[c] <0:
                return False
            
        if sum(hmaps.values()) == 0:
            return True
        return False
class Solution:
    def isAnagram(self, s: str, t: str) -> bool:
        hmaps = dict()
        for c in s:
            hmaps[c] = hmaps.get(c, 0) + 1
        
        for c in t:
            if c not in hmaps:
                return False
            hmaps[c] -=1
            if hmaps[c] <0:
                return False
            
        if sum(hmaps.values()) == 0:
            return True
        return False