Created
October 14, 2017 22:10
-
-
Save cixuuz/25b03bfd7f890e56a887cc6ba5dcef2c to your computer and use it in GitHub Desktop.
[242. Valid Anagram] #leetcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution(object): | |
# O(nlogn) | |
def isAnagram(self, s, t): | |
""" | |
:type s: str | |
:type t: str | |
:rtype: bool | |
""" | |
ss = sorted(s) | |
st = sorted(t) | |
return ss == st | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment