<doocs>0312.Burst Balloons_1.py
def maxCoins( nums: List[int]) -> int:
    nums = [1] + nums + [1]
    n = len(nums)
    dp = [[0] * n for _ in range(n)]
    for l in range(2, n):
        for i in range(n - l):
            j = i + l
            for k in range(i + 1, j):
                dp[i][j] = max(
                    dp[i][j], dp[i][k] + dp[k][j] + nums[i] * nums[k] * nums[j]
                )
    return dp[0][-1]
def sample_funcname ( var_0 : List [ int ] ) -> int :
    var_0 = [ 1 ] + var_0 + [ 1 ]
    var_5 = len ( var_0 )
    var_9 = [ [ 0 ] * var_5 for var_7 in range ( var_5 ) ]
    for var_11 in range ( 2 , var_5 ) :
        for var_12 in range ( var_5 - var_11 ) :
            var_13 = var_12 + var_11
            for var_14 in range ( var_12 + 1 , var_13 ) :
                var_9 [ var_12 ] [ var_13 ] = max ( var_9 [ var_12 ] [ var_13 ] , var_9 [ var_12 ] [ var_14 ] + var_9 [ var_14 ] [ var_13 ] + var_0 [ var_12 ] * var_0 [ var_14 ] * var_0 [ var_13 ] )
    return var_9 [ 0 ] [ - 1 ]
