c++ | easy | fast
\n\n# Code\n\nclass Solution {\npublic:\n    bool canTransform(string start, string end) {\n        \n        int i=0, j=0;\n        while(i<start.size() && j<e
\n\n# Code\n```\nclass Solution {\npublic:\n    bool canTransform(string start, string end) {\n        \n        int i=0, j=0;\n        while(i<start.size() && j<end.size()) {\n            \n            while(start[i]==\'X\') i++;\n            while(end[j]==\'X\') j++;\n            \n            if(start[i]!=end[j]) return false;\n            if(start[i]==\'R\' && i>j) return false;\n            if(start[i]==\'L\' && i<j) return false;\n            i++; j++;\n        }\n        while(i<start.size() && start[i]==\'X\') i++;\n        while(j<end.size() && end[j]==\'X\') j++;\n        return i==j;\n    }\n};\n```
['C++']