<doocs>0123.Best Time to Buy and Sell Stock III_1.py
def maxProfit( prices: List[int]) -> int:
    f1, f2, f3, f4 = -prices[0], 0, -prices[0], 0
    for price in prices[1:]:
        f1 = max(f1, -price)
        f2 = max(f2, f1 + price)
        f3 = max(f3, f2 - price)
        f4 = max(f4, f3 + price)
    return f4
def sample_funcname ( var_0 : List [ int ] ) -> int :
    var_4 , var_5 , var_6 , var_7 = - var_0 [ 0 ] , 0 , - var_0 [ 0 ] , 0
    for var_9 in var_0 [ 1 : ] :
        var_4 = max ( var_4 , - var_9 )
        var_5 = max ( var_5 , var_4 + var_9 )
        var_6 = max ( var_6 , var_5 - var_9 )
        var_7 = max ( var_7 , var_6 + var_9 )
    return var_7
