<jupyter_start><jupyter_text>说明：    给定两个字符串s和t，编写一个函数以确定t是否是s的字谜。    移动t的任意字符，让其等于s，如果可以返回True，否则返回FalseExample 1:    Input: s = "anagram", t = "nagaram"    Output: trueExample 2:    Input: s = "rat", t = "car"    Output: false注意：    1、您可以假设该字符串仅包含小写字母。跟进：    1、如果输入包含Unicode字符怎么办？    2、您将如何适应这种情况的解决方案？<jupyter_code>class Solution:
    def isAnagram(self, s: str, t: str) -> bool:
        return sorted(s) == sorted(t)
class Solution:
    def isAnagram(self, s: str, t: str) -> bool:
        if len(s) != len(t):
            return False
        # s 和 t中，出现的元素次数相同即可
        s_dict = {}
        t_dict = {}
        for i in range(len(s)):
            s_val = s[i]
            t_val = t[i]
            s_dict[s_val] = 1 if s_val not in s_dict else s_dict[s_val]+1
            t_dict[t_val] = 1 if t_val not in t_dict else t_dict[t_val]+1
        return s_dict == t_dict
print(ord('a'))
a = {'a': 1, 'b':2}
b = {'b': 2, 'a':1}
a == b<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14345114345114346, 'fraction_numerical': 0.013513513513513514, 'mean_word_length': 2.6203007518796992, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '515697', 'license': 'Apache-2.0', 'n_tokens_mistral': 458, 'n_tokens_neox': 484, 'n_words': 92, 'path': 'Hash Table/0903/242. Valid Anagram.ipynb', 'repo_name': 'YuHe0108/Leetcode', 'size': '962'}