It can be done in python for just one line, is that a good solution for solving this problem in this way.
def isAnagram(self, s, t):
:type s: str
:type t: str
return collections.Counter(s) == collections.Counter(t)