📅  最后修改于: 2022-03-11 14:56:24.008000             🧑  作者: Mango
def areAlmostEqual(self, s1: str, s2: str) -> bool:
if s2 == s1: return True
for k in set(s1):
if k not in s2: return False
cnt = 0
for i in range(len(s1)):
if s1[i] != s2[i]:
cnt += 1
return cnt == 2