Easy JAVA Solution!
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 
# 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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    public boolean canBeEqual(String s1, String s2) {\n        if(s1.length() != s2.length())\n            return false;\n        int n = s1.length();\n        char[] c1 = s1.toCharArray();\n        char[] c2 = s2.toCharArray();\n        for(int i=0; i<n; i++) {\n            if(c1[i] != c2[i]) {\n                int j = i + 2;\n                if(j < n && c2[j] == c1[i]) {\n                    char temp = c2[i];\n                    c2[i] = c2[j];\n                    c2[j] = temp;\n                }\n                else {\n                    return false;\n                }\n            }\n        }\n        return String.valueOf(c1).equals(String.valueOf(c2));\n    }\n}\n```
['Java']