✅ One Line Solution
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)Code #1Time complexity: O(n). Space complexity: O(1)
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)

# Code #1
Time complexity: $$O(n)$$. Space complexity: $$O(1)$$.
```python3
class Solution:
    def canChange(self, s: str, t: str) -> bool:
        return (f:=lambda q:(p for p in enumerate(q) if p[1]!='_')) and all(c==w and (i<=j,i>=j)[c=='L'] for (i,c),(j,w) in zip_longest(f(s),f(t),fillvalue=(0,'')))
```

<!--
# Code #1.1
Time complexity: $$O(n)$$. Space complexity: $$O(1)$$.
```python3
class Solution:
    def canChange(self, s: str, t: str) -> bool:
        return (f:=lambda q:(p for p in enumerate(q) if p[1]!='_')) and all((c==w)*(i<=j,i>=j)[c=='L'] for (i,c),(j,w) in zip_longest(f(s),f(t),fillvalue=(0,0)))
```
-->

# Code #2
Time complexity: $$O(n)$$. Space complexity: $$O(n)$$.
```python3
class Solution:
    def canChange(self, s: str, t: str) -> bool:
        return re.sub('_','',s)==re.sub('_','',t) and (f:=lambda q,s,t:min(accumulate((c==q)-(w==q) for c,w in zip(s,t)))>=0)('R',s,t) and f('L',s[::-1],t[::-1])
```
[Ref](https://leetcode.com/problems/move-pieces-to-obtain-a-string/solutions/5983924/python-one-line-solution)

---
See also similar solution: [777. Swap Adjacent in LR String](https://leetcode.com/problems/swap-adjacent-in-lr-string/solutions/6421848/one-line-solution-by-mikposp)

---
(Disclaimer 2: code above is just a product of fantasy packed into one line, it is not claimed to be 'true' oneliners - please, remind about drawbacks only if you know how to make it better)
['Two Pointers', 'String', 'Python', 'Python3']