Python 66ms one line


  • 0
    A
    class Solution(object):
        def isAnagram(self, s, t):
            """
            :type s: str
            :type t: str
            :rtype: bool
            """
            return {i:s.count(i) for i in set(s)} == {i:t.count(i) for i in set(t)}
    

Log in to reply
 

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