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. 夺命雷公狗---node.js---1node的下载和安装

    node目前有两个网站,一个是英文的,一个是中文的,,左边这个是长期有效版本,右边的是最新版本,在下面可以很清晰的看得到node的英文网站更新速度是比中文网站上的快的多 我们用来测试的版本是windo ...

  2. Logic and Fault simulation

    fault simulation是指对fault circuit的simulation,来locate manufacturing defects并且进行fault diagnosis. logic ...

  3. Perl中的替换(七)

    在Perl中使用s///进行替换操作,与m//进行查找操作类似. s/with (\w+)/against $1's team/;      ##第一个双斜线,表示被替代的文本.第二个双斜线,表示将替 ...

  4. (第九周)视频发布及git统计报告

    项目名:食物链教学工具 组名:奋斗吧兄弟 组长:黄兴 组员:李俞寰.杜桥.栾骄阳.王东涵 代码地址:HTTPS: https://git.coding.net/li_yuhuan/FoodChain. ...

  5. [OrangePi] Features (the features of Loboris's Images)

    boot0_sdcard.fex, u-boot.fex and kernel (uImage) created from sources kernel built with many feature ...

  6. 【sublime】插件安装:包管理器——Package Control

    首先,按CTRL+`,打开控制台   粘贴下面的代码,之后回车 如果是sublime3 import urllib.request,os,hashlib; h = '7183a2d3e96f11eea ...

  7. ubuntu遇到的命令

    sudo passwd root这个命令是给root用户设定密码.su root切换到root用户.sudo cp 文件 /var/www移动文件到一个目录unzip xxx.zip解压zip文件mk ...

  8. 使用git和github托管个人项目

    1.  安装 cygwin 和 cygwin 下的 git , 测试 git 命令可用;   参考: https://cygwin.com/install.html 2.  注册 github 账号: ...

  9. 精简高效的CSS命名准则/方法

    /* ---------------------single CSS----------------------- */ /* display */ .dn{display:none;} .di{di ...

  10. Asp.net Vnext ModelBinding

    Model Binding 本文已经同步到<Asp.net Vnext 系列教程 >中] Model binding(绑定)简单来说就是通过遍历ValueProvider(值提供者)获取的 ...