- class Solution(object):
- def isAnagram(self, s, t):
- """
- :type s: str
- :type t: str
- :rtype: bool
- """
- if len(s)!=len(t):
- return False
- s1 = {}
- for i in list(set(s)):
- s1[i]=s.count(i)
- s2 = {}
- for j in list(set(t)):
- s2[j]=t.count(j)
- return s1==s2
242. Valid Anagram(python)
猜你喜欢
转载自blog.csdn.net/weixin_41362649/article/details/79975873
今日推荐
周排行