String || Two-Pointer Approach || Easy to Understand
Intuition\nWhen we want to change one string (start) into another string (target), we need to think about how we can move the characters around. The characters 
# Intuition\nWhen we want to change one string (start) into another string (target), we need to think about how we can move the characters around. The characters \'L\' and \'R\' can only move left and right, respectively, and we can ignore underscores (_). Our first thought is to check if both strings have the same characters (ignoring underscores) and then see if we can rearrange them according to the movement rules.\n# Approach\n1. **Ignore Underscores:** First, we need to check if the characters in both strings (without underscores) are the same. If they are not, we cannot transform start into target.\n\n2. **Use Two Pointers:** We will use two pointers (like two fingers) to go through both strings: One pointer (i) will go through the start string.\nThe other pointer (j) will go through the target string.\n3. **Skip Underscores:** As we move our pointers, we will skip over any underscores (_) until we find a character.\n\n4. **Check Characters:** When both pointers point to characters (not underscores), we will check if they are the same. If they are not, we cannot transform start into target.\n\n**Movement Rules:** \nWe need to make sure that:\nIf we have an \'L\' in start, it should not be trying to move to the right in target.\nIf we have an \'R\' in start, it should not be trying to move to the left in target.\nFinish Check: If we reach the end of both strings at the same time, it means we can transform start into target.\n\n\n# Complexity\n- Time complexity:  **O(n)**\nwhere n is the length of the input strings `start` and `target`. This is because the algorithm iterates through both strings in a single pass, moving the indices `i` and `j` forward as it processes each character. The while loops for skipping underscores and the comparisons are all linear operations with respect to the length of the strings.\n- Space complexity: **O(1)**\nas the algorithm uses a constant amount of extra space. It only utilizes a few integer variables (`i`, `j`, and `n`) to keep track of indices and does not create any additional data structures that grow with the input size. Thus, the space used does not depend on the length of the input strings.\n# Code\n```java []\nclass Solution {\n    public boolean canChange(String start, String target) {\n       int i=0,j=0;\n       int n=start.length();\n       while(i<n || j<n){\n        while(i<n && start.charAt(i)==\'_\') i++;\n        while(j<n && target.charAt(j)==\'_\') j++;\n        if(i==n || j==n) return i==n && j==n; \n        if(start.charAt(i)!=target.charAt(j))  return false;\n        if(start.charAt(i)==\'L\' && i<j) return false;\n        if(start.charAt(i)==\'R\' && i>j) return false;\n        i++; j++;      \n       }\n       return true; \n    }\n}\n```
['Two Pointers', 'String', 'Java']