python solution,easy to understand by sorted()


  • 0
    W
    class Solution(object):
        def isAnagram(self, s, t):
            return sorted(list(s)) == sorted(list(t))
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.