Valid Anagram
easy
description accepted(one bang):
class Solution(object):
def isAnagram(self, s, t):
"""
:type s: str
:type t: str
:rtype: bool
"""
if len(s) != len(t):
return False
letter = {}
letter2 = {}
for i in s:
if i not in letter:
letter[i] = 1
else:
letter[i] += 1
for i in t:
if i not in letter2:
letter2[i] = 1
else:
letter2[i] += 1
if letter != letter2:
return False
else:
return True