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. oracle中的常用语句

    1:查看当前用户的缺省表空间 SELECT USERNAME, DEFAULT_TABLESPACE FROM USER_USERS; 2:查看当前用户的角色 SELECT * FROM USER_R ...

  2. PAT乙级 1006. 换个格式输出整数 (15)

    1006. 换个格式输出整数 (15) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 让我们用字母B来表示“百” ...

  3. MyEclipse安装插件的三种方法和使用心得

    本文讲解MyEclipse(MyEclipse10)的三种方法,以TestNG为例 Eclipse update site URL:  http://beust.com/eclipse. 一.通过My ...

  4. 安装交叉编译器arm-linux-gcc

    需要交叉编译环境故安装交叉编译环境    1.在宿主机的/usr/local/arm目录存放交叉编译器        mkdir /usr/local/arm    2.解压交叉编译器包至/usr/l ...

  5. [py]安装ipython

    系统:crunch bang11+python2.7.3 准备工具: sudo apt-get install python-pip python-dev build-essential 安装setu ...

  6. OpenCV 简介

    自版本OpenCV2.2开始,OpenCV库便被划分为多个模块.这些模块编译成库文件后,位于lib文件夹中. opencv_core模块,包含核心功能,尤其是底层数据结构和算法函数. opencv_i ...

  7. owner window 和 parent window 有什么区别?

    1.Pop-up窗口:   一个弹出窗口是必须具有WS_POPUP属性的窗口,弹出窗口只能是一个Top-Level窗口,不能是子窗口,弹出窗口多用于对话框和消                     ...

  8. javaWeb 使用cookie显示上次访问网站时间

    package de.bvb.cookie; import java.io.IOException; import java.io.PrintWriter; import java.util.Date ...

  9. peak num

    class Solution {public: int findPeakElement(vector<int>& nums) {    int i=0;    int n=nums ...

  10. Verilog HDL基础语法讲解之模块代码基本结构

    Verilog HDL基础语法讲解之模块代码基本结构   本章主要讲解Verilog基础语法的内容,文章以一个最简单的例子"二选一多路器"来引入一个最简单的Verilog设计文件的 ...