<doocs>1243.Array Transformation_1.py
def transformArray( arr: List[int]) -> List[int]:
    copy = [e for e in arr]
    has_change, n = True, len(arr)
    while has_change:
        has_change = False
        for i in range(1, n - 1):
            if arr[i] < copy[i - 1] and arr[i] < copy[i + 1]:
                arr[i] += 1
                has_change = True
            elif arr[i] > copy[i - 1] and arr[i] > copy[i + 1]:
                arr[i] -= 1
                has_change = True
        copy = [e for e in arr]
    return arr
def sample_funcname ( var_0 : List [ int ] ) -> List [ int ] :
    var_4 = [ var_3 for var_3 in var_0 ]
    var_6 , var_8 = True , len ( var_0 )
    while var_6 :
        var_6 = False
        for var_12 in range ( 1 , var_8 - 1 ) :
            if var_0 [ var_12 ] < var_4 [ var_12 - 1 ] and var_0 [ var_12 ] < var_4 [ var_12 + 1 ] :
                var_0 [ var_12 ] += 1
                var_6 = True
            elif var_0 [ var_12 ] > var_4 [ var_12 - 1 ] and var_0 [ var_12 ] > var_4 [ var_12 + 1 ] :
                var_0 [ var_12 ] -= 1
                var_6 = True
        var_4 = [ var_3 for var_3 in var_0 ]
    return var_0
