【leetcode】242. 有效的字母异位词 (python)

【leetcode】242. 有效的字母异位词 (python),第1张

import collections
class Solution(object):
    def isAnagram(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: bool
        """
        s_dic = collections.Counter(s)
        t_dic = collections.Counter(t)
        if s_dic == t_dic:
            return True
        return False

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/737710.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-28
下一篇 2022-04-28

发表评论

登录后才能评论

评论列表(0条)

保存