C++ || Easy approach
Here is my c++ code for this problem.\n\n# Complexity\n- Time complexity:(N)\n\n- Space complexity:O(1)\n\n# Code\n\nclass Solution {\npublic:\n    bool areAlmo
Here is my c++ code for this problem.\n\n# Complexity\n- Time complexity:(N)\n\n- Space complexity:O(1)\n\n# Code\n```\nclass Solution {\npublic:\n    bool areAlmostEqual(string s1, string s2) {\n        int pos1=0, pos2=0;\n        for (int i=0; i<s1.size(); i++){\n            if (s1[i]!= s2[i]){\n                pos1=i; \n                break;\n            }\n        }\n        for(int j= s1.size()-1; j>=0; j--){\n            if (s1[j]!= s2[j]){\n                pos2=j; \n                break;\n            }\n        }\n        swap(s2[pos1], s2[pos2]);\n        return s1==s2;\n    }\n};\n```
['Two Pointers', 'String', 'C++']