Beats 100% -----> Simple Approach
Intuition\nThe task is to determine if two strings of length 4, s1 and s2, can be made equal by swapping characters in specific positions. This problem requires
# Intuition\nThe task is to determine if two strings of length 4, `s1` and `s2`, can be made equal by swapping characters in specific positions. This problem requires us to check whether swapping the first and third characters or the second and fourth characters results in the two strings becoming identical.\n\n# Approach\n1. First, check if `s1` and `s2` are already equal.\n2. Swap the first and third characters of `s1`, and check if `s1` equals `s2`.\n3. Restore the original string by swapping back, then swap the second and fourth characters of `s1`.\n4. Finally, check if any of these swaps result in the strings being equal.\n\n# Complexity\n- Time complexity:  \n  $$O(1)$$ \u2014 since the string length is fixed (4 characters), comparisons and swaps are constant time operations.\n\n- Space complexity:  \n  $$O(1)$$ \u2014 no additional space is used apart from a few temporary variables.\n\n# Code\n```cpp\nclass Solution {\npublic:\n    bool canBeEqual(string s1, string s2) {\n        if (s1 == s2) return true;\n        swap(s1[0], s1[2]);\n        if (s1 == s2) return true;\n        swap(s1[0], s1[2]); // Restore original positions\n        swap(s1[1], s1[3]);\n        if (s1 == s2) return true;\n        swap(s1[0], s1[2]);\n        return s1 == s2;\n    }\n};\n```
['C++']