C++ - EASY Solution - O(N*log N)
 # Intuition  \n\n\n\n\n\n# Complexity\n- Time complexity:O(n*logn)\n\n\n- Space complexity:O(1)\n\n\n# Code\nC++ []\nclass Solution {\npublic:\n    bool areAlm
<!-- # Intuition -->\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n<!-- # Approach -->\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:$$O(n*logn)$$\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```C++ []\nclass Solution {\npublic:\n    bool areAlmostEqual(string s1, string s2) {\n        if (s1.length() != s2.length())\n        {\n            return false ;\n        }\n\n        int cnt = 0 ; \n        for (int i = 0 ; i < s1.length() ; i ++)\n        {\n            if (s1[i] != s2[i])\n            {\n                cnt ++ ;\n            }\n            else continue ; \n        }\n        sort(s1.begin(), s1.end()) ; \n        sort(s2.begin(), s2.end()) ; \n\n        if (s1 != s2)\n        {\n            return false ; \n        }\n\n        if (cnt == 2 || cnt == 0)\n        {\n            return true ; \n        }\n        return false ; \n    }\n};\n```\n![815a317f-9cdf-46e2-a397-af8869dafa2e_1673498197.3721023.png](https://assets.leetcode.com/users/images/30e43643-cfa1-4ed3-8022-d4aba2b399a3_1678339474.7291403.png)\n
['Hash Table', 'String', 'Counting', 'C++']