Beats 36% - But Super Straightforward Solution for Understanding
Intuition\n Describe your first thoughts on how to solve this problem. \nThe key intuition is that the characters \'L\' and \'R\' must appear in the same order 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe key intuition is that the characters \'L\' and \'R\' must appear in the same order in both start and target when ignoring underscores (_). This allows us to iterate through both strings simultaneously and compare the characters directly. If the characters at the current positions are not equal, it means one character would need to "pass over" another, which is invalid. By ensuring that \'L\' and \'R\' appear in the same order, we can check their movement rules (\'L\' can only move left, and \'R\' can only move right) to validate the transformation.\n\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    public boolean canChange(String start, String target) {\n\n        int startIndex = 0, targetIndex = 0;\n\n       while(startIndex < start.length() && targetIndex < target.length()) {\n\n            while(startIndex < start.length() && !Character.isLetter(start.charAt(startIndex))) {\n                startIndex++;\n            }\n\n            while(targetIndex < target.length() && !Character.isLetter(target.charAt(targetIndex))) {\n                targetIndex++;\n            }\n            \n            if(startIndex < start.length() && targetIndex < target.length()) {\n\n            char startChar = start.charAt(startIndex);\n            char targetChar = target.charAt(targetIndex);\n\n            if(startChar != targetChar) {\n                return false;\n            }\n            \n            if(start.charAt(startIndex) == \'L\' && targetIndex > startIndex) {\n                return false;\n            }\n\n            if(start.charAt(startIndex) == \'R\' && targetIndex < startIndex) {\n                  return false;\n            }\n            startIndex++;\n            targetIndex++;\n        }\n       }\n\n       while(startIndex < start.length()) {\n        if(start.charAt(startIndex) != \'_\') {\n            return false;\n        }\n        startIndex++;\n       }\n\n       while(targetIndex < target.length()) {\n        if(target.charAt(targetIndex) != \'_\') {\n            return false;\n        }\n        targetIndex++;\n       }\n        \n        return true;\n       }\n}\n```
['Java']