```
def isAnagram(self, s, t):
"""
:type s: str
:type t: str
:rtype: bool
"""
a = {}
for x in s:
if x not in a:
a[x] = 1
else:
a[x] += 1
for x in t:
if x not in a:
return False
else:
a[x] -= 1
if a[x] < 0:
return False
for x in a:
if a[x] > 0:
return False
return True
```