<doocs>1646.Get Maximum in Generated Array_1.py
def getMaximumGenerated( n: int) -> int:
    if n == 0:
        return 0
    nums = [0] * (n + 1)
    nums[1] = 1
    for i in range(2, n + 1):
        nums[i] = nums[i >> 1] if i % 2 == 0 else nums[i >> 1] + nums[(i >> 1) + 1]
    return max(nums)
def sample_funcname ( var_0 : int ) -> int :
    if var_0 == 0 :
        return 0
    var_4 = [ 0 ] * ( var_0 + 1 )
    var_4 [ 1 ] = 1
    for var_7 in range ( 2 , var_0 + 1 ) :
        var_4 [ var_7 ] = var_4 [ var_7 >> 1 ] if var_7 % 2 == 0 else var_4 [ var_7 >> 1 ] + var_4 [ ( var_7 >> 1 ) + 1 ]
    return max ( var_4 )
