题目:
题解:
class Solution:
def isIsomorphic(self, s: str, t: str) -> bool:
dicts = Counter(s)
dictt = Counter(t)
if list(dicts.values()) != list(dictt.values()):
return False
for i in range(len(s)):
inds = list(dicts.keys()).index(s[i])
if list(dictt.keys())[inds] != t[i]:
return False
return True