Easy Understandable Solution
Code\njava []\nclass Solution {\n    public boolean canBeEqual(String s1, String s2) {\n        char[] ch = s1.toCharArray();\n        if(s1.equals(s2)) {\n    
# Code\n``` java []\nclass Solution {\n    public boolean canBeEqual(String s1, String s2) {\n        char[] ch = s1.toCharArray();\n        if(s1.equals(s2)) {\n            return true;\n        }\n        for(int i=0; i<2; i++) {\n            if(ch[i]==s2.charAt(i+2)) {\n                char ct = ch[i];\n                ch[i] = ch[i+2];\n                ch[i+2] = ct;\n            }\n            if(String.valueOf(ch).equals(s2)) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n```\n\n# Complexity Analysis:\n- Time Complexity: $O(1)$\n- Space Complexity: $O(1)$
['String Matching', 'Java']