Javascript O(n) Time, O(1) Space Simple
Intuition\n\n1. We cannot move Rs and Ls past eachother. \n2. We cannot move Rs to the left.\n3. We cannot move Ls to the right.\n\njavascript\n/**\n * @param {
#### Intuition\n\n1. We cannot move Rs and Ls past eachother. \n2. We cannot move Rs to the left.\n3. We cannot move Ls to the right.\n\n```javascript\n/**\n * @param {string} start\n * @param {string} end\n * @return {boolean}\n */\nvar canTransform = function(start, end) {\n    let i = 0;\n    let j = 0;\n    \n    while (i < start.length || j < end.length) {\n        if (start[i] === \'X\') {\n            i++;\n            continue;\n        }\n        \n        if (end[j] === \'X\') {\n            j++;\n            continue;\n        }\n        \n\t\t// Breaking (1)\n        if (start[i] !== end[j]) return false;\n        \n\t\t// Breaking (2)\n        if (start[i] === \'R\' && i > j) return false;\n\t\t\n\t\t// Breaking (3)\n        if (start[i] === \'L\' && j > i) return false;\n        \n        i++;\n        j++;\n    }\n    \n    return true;\n};\n```\n\nExample:\n\nstart: XXRLX\nend:  XXLRX\n\nThis breaks (1) because the first non-X we find in start and end respectively will be R and L. We will never be able to swap R and L.\n\nstart: XXRXX\nend:  XRXXX\n\nThis breaks (2) because the index of the start R is greater than the index of end R. We can only move R to the right.\n\nstart: XXLXX\nend:  XXXLX\n\nThis breaks (3) because the index of the start L is less than the index of end L. We can only move L to the left.\n\nThere are implicit swapping rules and we just ensure that those rules are followed.
['TypeScript', 'JavaScript']