classSolution:defisAnagram(self, s:str, t:str)->bool:
dicts =[0]*26for i in s:
dicts[ord(i)-97]+=1for i in t:
dicts[ord(i)-97]-=1for i inrange(26):if dicts[i]!=0:returnFalsereturnTrue
# 字典哈希classSolution:defintersection(self, nums1: List[int], nums2: List[int])-> List[int]:
nums1_dict ={}
res =[]for i in nums1:
nums1_dict[i]=1for i in nums2:if i in nums1_dict.keys()and nums1_dict[i]==1:
res.append(i)
nums1_dict[i]=0return res