Simple one pass solution O(n) c++
\n    bool canTransform(string start, string end) {\n        int l = 0;\n        int r = 0;\n        for(int i = 0;i<start.size();i++){\n            if(start[i]
```\n    bool canTransform(string start, string end) {\n        int l = 0;\n        int r = 0;\n        for(int i = 0;i<start.size();i++){\n            if(start[i]==\'R\'){\n                r++;\n            }\n            if(end[i]==\'L\'){\n                l++;\n            }\n            if(l&&r) return false;\n            if(start[i]==\'L\'){\n                l--;\n                if(l==-1) return false;\n            }\n            if(end[i]==\'R\'){\n                r--;\n                if(r==-1) return false;\n            }\n        }\n        return l==0&&r==0;\n    }\n```
['C']