💯💯 Simple Solution for java coders
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        int i=0,j=2;\n        if(s1.equals(s2)){\n            return true;\n        }\n        char c[]=s2.toCharArray();\n        while(j<s2.length()){\n            if(s1.charAt(i)!=c[i]){\n                char temp=c[i];\n                c[i]=c[j];\n                c[j]=temp;\n            }\n            String str=new String(c);\n            if(str.equals(s1)){\n                return true;\n            }\n            i++;\n            j++;\n        }\n        return false;\n    }\n}\n```
['Java']