Python solution using Dictionary
Code\n\nclass Solution:\n    def areAlmostEqual(self, s1: str, s2: str) -> bool:\n        c=0\n        d={}\n        dd={}\n        for i in range(len(s1)):\n  
# Code\n```\nclass Solution:\n    def areAlmostEqual(self, s1: str, s2: str) -> bool:\n        c=0\n        d={}\n        dd={}\n        for i in range(len(s1)):\n            if s1[i] not in d:\n                d[s1[i]]=1\n            else:\n                d[s1[i]]+=1\n            if s2[i] not in dd:\n                dd[s2[i]]=1\n            else:\n                dd[s2[i]]+=1\n\n            if s1[i]!=s2[i]:\n                c+=1\n        if (c==2 or c==0) and sorted(d.items())==sorted(dd.items()):\n            return True\n        else:\n            return False\n```
['Python3']