Java Solution
\nclass Solution {\n    public boolean canChange(String start, String target) {\n        String onlyDirsStart = start.replace("_", "");\n        String onlyDirs
```\nclass Solution {\n    public boolean canChange(String start, String target) {\n        String onlyDirsStart = start.replace("_", "");\n        String onlyDirsTarget = target.replace("_", "");\n        if (!onlyDirsStart.equals(onlyDirsTarget)) {\n            return false;\n        }\n        int balance = 0;\n        for (int i = 0; i < start.length(); i++) {\n            if (target.charAt(i) == \'L\') {\n                balance++;\n            }\n            if (start.charAt(i) == \'L\') {\n                balance--;\n            }\n            if (balance < 0) {\n                return false;\n            }\n        }\n        balance = 0;\n        for (int i = start.length() - 1; i >= 0; i--) {\n            if (target.charAt(i) == \'R\') {\n                balance++;\n            }\n            if (start.charAt(i) == \'R\') {\n                balance--;\n            }    \n            if(balance < 0) {\n                return false;\n            }\n        }\n        return true;\n    }\n}\n```
['Java']