Two pointer approach || Easiest
\n# Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n\n
\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    bool areAlmostEqual(string s1, string s2) {\n        if (s1==s2) return true;\n        int l=0,r=s1.size()-1;\n        while(s1[l]==s2[l]) l++;\n        while(s1[r]==s2[r]) r--;\n        swap(s1[l],s1[r]);\n        return s1==s2;\n    }\n};\n```
['C++']