[5 Lines] Very Elegant Functional Solution (Python)
There are just 3 conditions:\n1. since the L and R blocks can never pass each other, their order must be the same. \n2. every L in target must be to the left or
There are just 3 conditions:\n1. since the L and R blocks can never pass each other, their order must be the same. \n2. every L in `target` must be to the left or same as the corresponding L in `start`    \n3. every R in `target` must be to the right or same as the corresponding R in `start`   \n\n```py\nclass Solution:\n    def canChange(self, A: str, B: str) -> bool:\n        P = lambda c    :  c != \'_\'\n        I = lambda s,x  :  [i for i,c in enumerate(s) if c==x]\n        G = lambda d,p  :  all( p(x,y) for x,y in zip( I(A,d), I(B,d) ) )\n        S = lambda      :  [*filter(P,A)] == [*filter(P,B)]\n        return S() and G(\'L\', ge) and G(\'R\', le)\n\t\t#      1.          2.             3.\n```\n\nNotes to clear up confusion:\n1. `filter(predicate, iterable)` returns a filter object with the elements that trigger the predicate removed\n2. `[ *filter(P,A) ]` unpacks the filter object (similar to a generator/iterator) into a list\n3. `S()` returns whether or not the `\'L\'` and `\'R\'` characters appear in the same order.\n4. `I(s, x)` returns a List of the indices at which `x` occurs in `s`\n5. `G(d, p)` returns whether or not `p(x,y)` is true for all corresponding pairs `x,y` of `d`\n6. `le` and `ge` are functional equivalents of `<=` and `>=` operators, found in `operator` module\n\nPlease leave an upvote if you liked it/learned something, or comment if you have any questions!
[]