Java | Intuitive | Just traverse both Strings | O(n)
Approach\n\nJust traverse both the strings and check whether relative charcters (\'R\' or \'L\') are equal or not, if they are equal, then check their relative 
**Approach**\n\nJust traverse both the strings and check whether relative charcters (\'R\' or \'L\') are equal or not, if they are equal, then check their relative positions to see whether `start` can be converted to `target` or not\n\n**e.g.** \'-R\' and \'R-\' => here, relative characters \'R\' and \'R\' are equal but index of \'R\' in `start` is greater than index of \'R\' in  `target`, since \'R\' can\'t move left, hence we return false for this test case\n\n**Time Complexity** => O(n)\n\n```\npublic boolean canChange(String start, String target) {\n        if (start.length() != target.length()) {\n            return false;\n        }\n        \n        int i = 0, j = 0;\n        \n        while (i < start.length() || j < target.length()) {\n            while (i < start.length() && start.charAt(i) == \'_\') {\n                i++;\n            }\n            \n            while (j < target.length() && target.charAt(j) == \'_\') {\n                j++;\n            }\n            \n            // if both i and j reach end of string\n            if (i == j && i == start.length()) {\n                return true;\n            }\n            \n            if (i == start.length() || j == target.length() || start.charAt(i) != target.charAt(j)) {\n                return false;\n            }\n            \n            // if characters at both i and j are equal, check their relative positions in both start and target\n            if ((target.charAt(j) == \'L\' && i < j) || (target.charAt(j) == \'R\' && i > j)) {\n                return false;\n            }\n            \n            i++;\n            j++;\n        }\n        \n        return true;\n    }\n```
['Java']