share my codes -- beats 98.48%~~surprise~~Lol


  • 0

    share my codes -- beats 98.48%surpriseLol
    '''
    class Solution(object):
    def isAnagram(self, s, t):
    """
    :type s: str
    :type t: str
    :rtype: bool
    """
    dic_s = collections.defaultdict(int)
    dic_t = collections.defaultdict(int)
    for i in s:
    dic_s[i] += 1
    for i in t:
    dic_t[i] += 1
    return dic_s == dic_t

    '''


Log in to reply
 

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