艾晓雪

关注

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

艾晓雪

关注

阅读 46

2022-04-26

在这里插入图片描述

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

相关推荐

大南瓜鸭

242. 有效的字母异位词

大南瓜鸭 33 0 0

修炼之士

【LeetCode 11】242.有效的字母异位词

修炼之士 78 0 0

佛贝鲁先生

LeetCode 242.有效的字母异位词(简单)

佛贝鲁先生 58 0 0

独兜曲

leetcode算法242.有效的字母异位词

独兜曲 48 0 0

舍予兄

【LeetCode】242. 有效的字母异位词(js 实现)

舍予兄 70 0 0

霸姨

242. 有效的字母异位词、Leetcode的Go实现

霸姨 28 0 0

覃榜言

242. 有效的字母异位词 (Leetcode刷题笔记)

覃榜言 41 0 0

一葉_code

力扣:242.有效的字母异位词

一葉_code 80 0 0

一ke大白菜

力扣:242. 有效的字母异位词

一ke大白菜 62 0 0

花海书香

leetcode 242. 有效的字母异位词 思考分析

花海书香 49 0 0

精彩评论(0)

0 0 举报