<doocs>0413.Arithmetic Slices_1.py
def numberOfArithmeticSlices( nums: List[int]) -> int:
    n = len(nums)
    dp = [0] * n
    for i in range(2, n):
        if nums[i] + nums[i - 2] == (nums[i - 1] << 1):
            dp[i] = 1 + dp[i - 1]
    return sum(dp)
def sample_funcname ( var_0 : List [ int ] ) -> int :
    var_4 = len ( var_0 )
    var_6 = [ 0 ] * var_4
    for var_9 in range ( 2 , var_4 ) :
        if var_0 [ var_9 ] + var_0 [ var_9 - 2 ] == ( var_0 [ var_9 - 1 ] << 1 ) :
            var_6 [ var_9 ] = 1 + var_6 [ var_9 - 1 ]
    return sum ( var_6 )
