Simple C++ One Pass Scan Solution
\nclass Solution {\npublic:\n    bool canChange(string start, string target) {\n        int i=0,j=0;\n        while(true)\n        {\n            while(i < star
```\nclass Solution {\npublic:\n    bool canChange(string start, string target) {\n        int i=0,j=0;\n        while(true)\n        {\n            while(i < start.length() && start[i] == \'_\')\n                 i++;\n            while(j < target.length() && target[j] == \'_\')\n                j++;\n            if (i == start.length() && j == target.length())\n                return true;\n            else if ((i != start.length() && j == target.length())\n                || (i == start.length() && j != target.length()))\n                return false;\n            else if (start[i] != target[j])\n                return false;\n            else if (start[i] == \'L\' && (i>=j))\n                  i++,j++;\n            else if (start[i] == \'R\' && (i<=j))\n                  i++,j++;\n            else\n                return false;\n        }\n        return false;\n    }\n};\n```\n\n\nscan both the strings from start. \nlets i is the index of scanner in start string,\nj is the index of the scanner in the target string.\n\nmove i till you find an L or R.\nmove j till you find an L or R.\n\nif start[i] or target[j] don\'t match (i.e. one is R and one is L) then it is impossible to convert.\nif start[i] and target[j] both are L, then j has to be in the left (lesser) of the i as we can only shift L to left.\nSimilarly if both are R, then j has to be in the right of i (greater).\n\n
['C']