comefrom: <qiyuangong>123_Best_Time_to_Buy_and_Sell_Stock_III_1.py
code: 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
masked: def sample_funcname ( var_0 ) :
      var_1 = len ( var_0 )
      if var_1 == 0 :
          return 0
      var_2 , var_3 = 2 , 0
      var_5 = [ [ 0 ] * var_1 for var_4 in range ( var_2 + 1 ) ]
      for var_6 in range ( 1 , var_2 + 1 ) :
          var_7 = var_5 [ var_6 - 1 ] [ 0 ] - var_0 [ 0 ]
          for var_8 in range ( 1 , var_1 ) :
              var_5 [ var_6 ] [ var_8 ] = max ( var_5 [ var_6 ] [ var_8 - 1 ] , var_0 [ var_8 ] + var_7 )
              var_7 = max ( var_7 , var_5 [ var_6 - 1 ] [ var_8 ] - var_0 [ var_8 ] )
              var_3 = max ( var_5 [ var_6 ] [ var_8 ] , var_3 )
      return var_3
  