class Solution(object):
    def isAnagram(self, s, t):
        if sorted(list(s.lower()))==sorted(list(t.lower())):
            return True
        return False

sol=Solution()
print sol.isAnagram(s='anAgram', t='nagaram')

【leetcode❤python】242. Valid Anagram的更多相关文章

  1. [LeetCode&Python] Problem 242. Valid Anagram

    Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Input: ...

  2. 【leetcode❤python】 125. Valid Palindrome

    #-*- coding: UTF-8 -*- class Solution(object):    def isPalindrome(self, s):        ""&quo ...

  3. 【leetcode❤python】 20. Valid Parentheses

    #-*- coding: UTF-8 -*-#利用栈的思想#如果输入的左测扩则入栈,如果输入为右侧扩,判断其是否与当前栈顶配对,如果匹配则删除这一对,否则return False#'(', ')', ...

  4. 【leetcode❤python】 36. Valid Sudoku

    #-*- coding: UTF-8 -*-#特定的九个格内1-9的个数至多为1#依次检查每行,每列,每个子九宫格是否出现重复元素,如果出现返回false,否则返回true.class Solutio ...

  5. 【LeetCode】242. Valid Anagram (2 solutions)

    Valid Anagram Given two strings s and t, write a function to determine if t is an anagram of s. For ...

  6. 【leetcode❤python】Sum Of Two Number

    #-*- coding: UTF-8 -*- #既然不能使用加法和减法,那么就用位操作.下面以计算5+4的例子说明如何用位操作实现加法:#1. 用二进制表示两个加数,a=5=0101,b=4=0100 ...

  7. 【LeetCode】242. Valid Anagram 解题报告(Java & Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 字典统计词频 排序 日期 [LeetCode] 题目地址:ht ...

  8. 【一天一道LeetCode】#242. Valid Anagram

    一天一道LeetCode 本系列文章已全部上传至我的github,地址:ZeeCoder's Github 欢迎大家关注我的新浪微博,我的新浪微博 欢迎转载,转载请注明出处 (一)题目 Given t ...

  9. 【LeetCode】242 - Valid Anagram

    Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = &q ...

随机推荐

  1. android环境搭建—— 工欲善其事必先利其器

    安卓开发环境配置: 准备软件 a)  JDK  点击下载 b)   adt-bundle-windows-x86-20140702.zip   点击下载 [sdk + 特定版本platform + e ...

  2. 关于centos更新后virtualbox无法使用的问题

    http://blog.csdn.net/zgglj/article/details/50325675

  3. 查看linux的出错信息

    先执行:dmesg -c > /dev/null 该命令是把之前的一些信息删除,-c选项表示:Clear the ring buffer after first printing its con ...

  4. [OrangePi] Installation on SD Card

    Download any of the available images (xz archive) from Mega or GoogleDrive Download scriptbin_kernel ...

  5. opencv常用数据结构之:IplImage

    typedef struct_IplImage{      int nSize; //IplImage大小      int ID; //版本(=0)      int nChannels; //大多 ...

  6. Sqlserver 平面文件导入/ SSIS FlatFileSource导入文件时 出现LocaleID is not installed报错问题

    最近在使用SqlServer和SSIS导入一个CSV文件到数据库时(SSIS选用的FlatFileSource作为数据流源),老是遇到  The LocaleID 4 is not installed ...

  7. RMB转换人民币大小金额

    MXS&Vincene  ─╄OvЁ  &0000015 ─╄OvЁ  MXS&Vincene MXS&Vincene  ─╄OvЁ:今天很残酷,明天更残酷,后天很美好 ...

  8. GPS学习

    1.每一个你不满意的现在,都有一个你没有努力的曾经. //ios根据gps坐标来计算两点间的距离 //x1,y1 点1的坐标 x2,y2点2的坐标 -(double) gps2m:(double)x1 ...

  9. 【JQGRID DOCUMENTATION】.学习笔记.1.安装jqGrid

    前面介绍了怎么使用其MVC方式,很好用.不过,觉得还是只使用前段比较好. 1.1 如何安装 到http://www.trirand.com/blog/?page_id=6 下载. </html& ...

  10. [STL]set/multiset用法详解[自从VS2010开始,set的iterator类型自动就是const的引用类型]

    集合 使用set或multiset之前,必须加入头文件<set> Set.multiset都是集合类,差别在与set中不允许有重复元素,multiset中允许有重复元素. sets和mul ...