楼主: 
dont   2024-12-05 21:03:532337. Move Pieces to Obtain a String
## 思路
two pointer
每次loop 检查跳过`_`后遇到的字符
如果字符一样, 就再检查index
R: 右移 (idx_start <= idx_target
L: 左移 (idx_start >= idx_target
## Code
```python
class Solution:
    def canChange(self, start: str, target: str) -> bool:
        n = len(start)
        i = j = 0
        while True:
            while i < n and start[i] == '_':
                i += 1
            while j < n and target[j] == '_':
                j += 1
            if i == n or j == n:
                break
            if start[i] != target[j]:
                return False
            if start[i] == 'L' and i < j:
                return False
            if start[i] == 'R' and i > j:
                return False
            i += 1
            j += 1
        return i == j == n
```