class Solution(object):
def isAnagram(self, s, t):
"""
:type s: str
:type t: str
:rtype: bool
"""
dic=collections.Counter(s)
dic1=collections.Counter(t)
if len(dic)!=len(dic1):
return False
for i in dic:
if dic[i]!=dic1[i]:
return False
return True
def isAnagram(self, s, t):
"""
:type s: str
:type t: str
:rtype: bool
"""
dic=collections.Counter(s)
dic1=collections.Counter(t)
if len(dic)!=len(dic1):
return False
for i in dic:
if dic[i]!=dic1[i]:
return False
return True