JavaScript Time O(n)
\n/**\n * @param {string} start\n * @param {string} end\n * @return {boolean}\n */\nvar canTransform = function(start, end) {\n    let R = 0\n    let L = 0\n   
```\n/**\n * @param {string} start\n * @param {string} end\n * @return {boolean}\n */\nvar canTransform = function(start, end) {\n    let R = 0\n    let L = 0\n    if (start.length != end.length) {\n        return false\n    }\n    var i = 0\n    while (i < start.length) {\n        let char_s = start[i]\n        let char_e = end[i] \n        if (char_s === \'R\') {\n            R += 1\n        } else if (char_s === \'L\') {\n            L += 1\n        }     \n        if (L < 0 && R > 0) {\n            return false\n        }        \n        \n        if (char_e === \'R\') {\n            R -= 1\n        } else if (char_e === \'L\') {\n            L -= 1\n        }\n        if (L > 0 || R < 0) {\n            return false\n        }\n        if (L < 0 && R > 0) {\n            return false\n        }   \n        i++\n    }\n    \n    return L === 0 && R === 0\n};\n```
[]