```
from collections import defaultdict
class Solution(object):
def isAnagram(self, s, t):
sdic = defaultdict(int)
tdic = defaultdict(int)
if not s and not t:
return True
elif (len(s) != len(t)):
return False
else:
for i in range(0, len(s)):
sdic[(ord(s[i]))] += 1
tdic[(ord(t[i]))] += 1
for i in s:
if sdic[ord(i)] != tdic[ord(i)]:
return False
return True
```