Short and clean JAVA code
\n\tpublic boolean canTransform(String start, String end) {\n\t\tif (!start.replace("X", "").equals(end.replace("X", ""))) return false;\n\n\t\tint i = 0, j = 0
```\n\tpublic boolean canTransform(String start, String end) {\n\t\tif (!start.replace("X", "").equals(end.replace("X", ""))) return false;\n\n\t\tint i = 0, j = 0;\n\t\tint len = start.length();\n\n\t\twhile (i < len && j < len) {\n\t\t\twhile (i < len && start.charAt(i) == \'X\') i++;\n\t\t\twhile (j < len && end.charAt(j) == \'X\') j++;\n\t\t\tif (i < len && start.charAt(i) == \'L\' && i < j) return false;\n\t\t\tif (i < len && start.charAt(i) == \'R\' && i > j) return false;\n\t\t\ti++;\n\t\t\tj++;\n\t\t}\n\n\t\treturn true;\n\t}\n```
[]