C++ 10 Line O(n) Solution
````\n    bool canTransform(string start, string end) {\n\n        string s, t;\n        \n        FORI (0, start.size ()) if (start[i] != 'X') s += start[i];\n
````\n    bool canTransform(string start, string end) {\n\n        string s, t;\n        \n        FORI (0, start.size ()) if (start[i] != 'X') s += start[i];\n        FORI (0, end.size ()) if (end[i] != 'X') t += end[i];\n        \n        if (s != t) return false;\n        else {\n            int sR = 0, sL = 0, eR = 0, eL = 0;\n            FORI (0, start.size ()) {\n                if (start[i] == 'L') sL++;\n                if (start[i] == 'R') sR++;\n                if (end[i] == 'R') eR++;\n                if (end[i] == 'L') eL++;\n\n                if (eR > sR) return false;\n                if (sL > eL) return false;\n            }\n        }\n        \n        return true;\n    }
[]