Beats 100 % || Most Efficient Solution || C++
\n\n# Code\n\nclass Solution {\npublic:\n    bool areAlmostEqual(string s1, string s2) {\n        if(s1==s2) return true;\n        int s=0,e=s1.size()-1;\n     
\n\n# Code\n```\nclass Solution {\npublic:\n    bool areAlmostEqual(string s1, string s2) {\n        if(s1==s2) return true;\n        int s=0,e=s1.size()-1;\n        while(s1[s]==s2[s]) s++;\n        while(s1[e]==s2[e]) e--;\n        swap(s1[s],s1[e]);\n        return s1==s2;\n    }\n};\n```
['C++']