Accepted: one line python code..

  • 0

    It can be done in python for just one line, is that a good solution for solving this problem in this way.

    class Solution(object):
    def isAnagram(self, s, t):
    :type s: str
    :type t: str
    :rtype: bool
    return collections.Counter(s) == collections.Counter(t)

Log in to reply

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