242. Valid Anagram

xiaoxiao2021-02-28  83

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
转载请注明原文地址: https://www.6miu.com/read-61270.html

最新回复(0)