<doocs>0135.Candy_1.py
def candy( ratings: List[int]) -> int:
    n = len(ratings)
    left = [1] * n
    right = [1] * n
    for i in range(1, n):
        if ratings[i] > ratings[i - 1]:
            left[i] = left[i - 1] + 1
    for i in range(n - 2, -1, -1):
        if ratings[i] > ratings[i + 1]:
            right[i] = right[i + 1] + 1
    return sum(max(a, b) for a, b in zip(left, right))
def sample_funcname ( var_0 : List [ int ] ) -> int :
    var_4 = len ( var_0 )
    var_6 = [ 1 ] * var_4
    var_7 = [ 1 ] * var_4
    for var_9 in range ( 1 , var_4 ) :
        if var_0 [ var_9 ] > var_0 [ var_9 - 1 ] :
            var_6 [ var_9 ] = var_6 [ var_9 - 1 ] + 1
    for var_9 in range ( var_4 - 2 , - 1 , - 1 ) :
        if var_0 [ var_9 ] > var_0 [ var_9 + 1 ] :
            var_7 [ var_9 ] = var_7 [ var_9 + 1 ] + 1
    return sum ( max ( var_13 , var_14 ) for var_13 , var_14 in zip ( var_6 , var_7 ) )
