<doocs>2337.Move Pieces to Obtain a String_1.py
def canChange( start: str, target: str) -> bool:
    a = [(v, i) for i, v in enumerate(start) if v != '_']
    b = [(v, i) for i, v in enumerate(target) if v != '_']
    if len(a) != len(b):
        return False
    for (c, i), (d, j) in zip(a, b):
        if c != d:
            return False
        if c == 'L' and i < j:
            return False
        if c == 'R' and i > j:
            return False
    return True
def sample_funcname ( var_0 : str , var_2 : str ) -> bool :
    var_8 = [ ( var_4 , var_5 ) for var_5 , var_4 in enumerate ( var_0 ) if var_4 != '_' ]
    var_9 = [ ( var_4 , var_5 ) for var_5 , var_4 in enumerate ( var_2 ) if var_4 != '_' ]
    if len ( var_8 ) != len ( var_9 ) :
        return False
    for ( var_13 , var_5 ) , ( var_14 , var_15 ) in zip ( var_8 , var_9 ) :
        if var_13 != var_14 :
            return False
        if var_13 == 'L' and var_5 < var_15 :
            return False
        if var_13 == 'R' and var_5 > var_15 :
            return False
    return True
