Easy Solution Check all Cases - TC O(1)
\n    class Solution {\n       public boolean canBeEqual(String s1, String s2) {\n          if(s1.charAt(0) !=s2.charAt(0) && s1.charAt(2)!=s2.charAt(2)){\n    
\n    class Solution {\n       public boolean canBeEqual(String s1, String s2) {\n          if(s1.charAt(0) !=s2.charAt(0) && s1.charAt(2)!=s2.charAt(2)){\n              if(s1.charAt(0) !=s2.charAt(2) || s1.charAt(2)!=s2.charAt(0)){\n                 return false;\n             }\n         } \n         else if(s1.charAt(0) !=s2.charAt(0) && s1.charAt(2)==s2.charAt(2) || s1.charAt(0) ==s2.charAt(0) && s1.charAt(2)!=s2.charAt(2)){\n             return false;\n         }\n         if(s1.charAt(1) !=s2.charAt(1) && s1.charAt(3)!=s2.charAt(3)){\n             if(s1.charAt(1) !=s2.charAt(3) || s1.charAt(3)!=s2.charAt(1)){\n                 return false;\n             }\n         }\n         else if(s1.charAt(1) ==s2.charAt(1) && s1.charAt(3)!=s2.charAt(3) || s1.charAt(1) !=s2.charAt(1) && s1.charAt(3)==s2.charAt(3)){\n             return false;\n         }\n         return true;\n      }\n   }
['Java']