<qiyuangong>123_Best_Time_to_Buy_and_Sell_Stock_III_1.py
def maxProfit( prices):
    ls = len(prices)
    if ls == 0:
        return 0
    num_t, max_profit = 2, 0
    dp = [[0] * ls for _ in range(num_t + 1)]
    for t in range(1, num_t + 1):
        tempMax = dp[t - 1][0] - prices[0]
        for i in range(1, ls):
            dp[t][i] = max(dp[t][i - 1], prices[i] + tempMax)
            tempMax = max(tempMax, dp[t - 1][i] - prices[i])
            max_profit = max(dp[t][i], max_profit)
    return max_profit
def sample_funcname ( var_0 ) :
    var_2 = len ( var_0 )
    if var_2 == 0 :
        return 0
    var_5 , var_6 = 2 , 0
    var_10 = [ [ 0 ] * var_2 for var_7 in range ( var_5 + 1 ) ]
    for var_11 in range ( 1 , var_5 + 1 ) :
        var_12 = var_10 [ var_11 - 1 ] [ 0 ] - var_0 [ 0 ]
        for var_13 in range ( 1 , var_2 ) :
            var_10 [ var_11 ] [ var_13 ] = max ( var_10 [ var_11 ] [ var_13 - 1 ] , var_0 [ var_13 ] + var_12 )
            var_12 = max ( var_12 , var_10 [ var_11 - 1 ] [ var_13 ] - var_0 [ var_13 ] )
            var_6 = max ( var_10 [ var_11 ] [ var_13 ] , var_6 )
    return var_6
