text: '''
  Given two strings s and t, return true if t is an anagram of s, and false otherwise.
  Example 1:
  
  Input: s = "anagram", t = "nagaram"
  Output: true
  Example 2:
  
  Input: s = "rat", t = "car"
  Output: false
  '''
  
  
  class Solution:
      def isAnagram(self, s: str, t: str) -> bool:
          from collections import defaultdict
          s_dict = defaultdict(int)
          t_dict = defaultdict(int)
          for x in s:
              s_dict[x] += 1
          for x in t:
              t_dict[x] += 1
          return s_dict == t_dict