Easy-understanding Java solution
\nclass Solution {\n    public boolean canTransform(String start, String end) {\n        char[] s = start.toCharArray();\n        char[] e = end.toCharArray();\
```\nclass Solution {\n    public boolean canTransform(String start, String end) {\n        char[] s = start.toCharArray();\n        char[] e = end.toCharArray();\n        if (s.length != e.length) return false;\n        for (int i = 0; i < s.length; i++) {\n            if (s[i] == e[i]) continue;\n            if (s[i] != 'X' && e[i] != 'X') return false;\n            if (s[i] == 'L' && e[i] == 'X') return false;\n            if (s[i] == 'X' && e[i] == 'R') return false;\n            if (s[i] == 'R' && e[i] == 'X') {\n                int nextR = findNext(s, i+1, 'X', 'R');\n                if (nextR == -1) return false;\n                else swap(s, i, nextR);\n            } else if (s[i] == 'X' && e[i] == 'L') {\n                int nextL = findNext(s, i+1, 'L', 'X');\n                if (nextL == -1) return false;\n                else swap(s, i, nextL);\n            }\n            \n        }\n        return true;\n    }\n    private int findNext(char[] s, int startIdx, char target, char skip) {\n        for (int i = startIdx; i < s.length; i++) {\n            if (s[i] == target) return i;\n            else if (s[i] == skip) continue;\n            else return -1;\n        }\n        return -1;\n    }\n    private void swap(char[] s, int i, int j) {\n        char tmp = s[i];\n        s[i] = s[j];\n        s[j] = tmp;\n    }\n}\n```
[]