<doocs>1846.Maximum Element After Decreasing and Rearranging_1.py
def maximumElementAfterDecrementingAndRearranging( arr: List[int]) -> int:
    arr.sort()
    arr[0] = 1
    for i in range(1, len(arr)):
        d = max(0, arr[i] - arr[i - 1] - 1)
        arr[i] -= d
    return max(arr)
def sample_funcname ( var_0 : List [ int ] ) -> int :
    var_0.sort ( )
    var_0 [ 0 ] = 1
    for var_8 in range ( 1 , len ( var_0 ) ) :
        var_10 = max ( 0 , var_0 [ var_8 ] - var_0 [ var_8 - 1 ] - 1 )
        var_0 [ var_8 ] -= var_10
    return max ( var_0 )
