Simple C++  solution
\nclass Solution {\npublic:\n    bool canTransform(string start, string end) {\n        if(start.length() == 1)\n            return start == end;\n        int n
```\nclass Solution {\npublic:\n    bool canTransform(string start, string end) {\n        if(start.length() == 1)\n            return start == end;\n        int n = start.length();\n        int i = 0;\n        int j = 0;\n        while(1)\n        {\n            while(i<n and start[i] == \'X\')\n                i++;\n            while(j<n and end[j] == \'X\')\n                j++;\n            if(i==n or j==n)\n                return i==j;\n            if(start[i] != end[j])\n                return false;\n            if(start[i] == \'R\' and i>j)\n                return false;\n            if(start[i] == \'L\' and i<j)\n                return false;\n            i++;\n            j++;\n        }\n        return true;\n    }\n};\n```
[]