0
点赞
收藏
分享

微信扫一扫

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

艾晓雪 2022-04-26 阅读 35

在这里插入图片描述

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

举报

相关推荐

0 条评论