做不动了,就做点简单题调节一下。
class Solution: def isAnagram(self, s: str, t: str) -> bool: if len(s)!=len(t): return False a=set(s) for i in a: if i not in t or s.count(i)!=t.count(i): return False return True
leetcode——242. 有效的字母异位词
原文:https://www.cnblogs.com/taoyuxin/p/11688579.html