Skip to content

Instantly share code, notes, and snippets.

@cixuuz
Created October 14, 2017 22:10
Show Gist options
  • Save cixuuz/25b03bfd7f890e56a887cc6ba5dcef2c to your computer and use it in GitHub Desktop.
Save cixuuz/25b03bfd7f890e56a887cc6ba5dcef2c to your computer and use it in GitHub Desktop.
[242. Valid Anagram] #leetcode
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