comefrom: <doocs>1049.Last Stone Weight II_1.py
code: def lastStoneWeightII( stones: List[int]) -> int:
      s = sum(stones)
      m, n = len(stones), s >> 1
      dp = [0] * (n + 1)
      for v in stones:
          for j in range(n, v - 1, -1):
              dp[j] = max(dp[j], dp[j - v] + v)
      return s - dp[-1] * 2
masked: def sample_funcname ( var_0 : List [ int ] ) -> int :
      var_1 = sum ( var_0 )
      var_2 , var_3 = len ( var_0 ) , var_1 >> 1
      var_4 = [ 0 ] * ( var_3 + 1 )
      for var_5 in var_0 :
          for var_6 in range ( var_3 , var_5 - 1 , - 1 ) :
              var_4 [ var_6 ] = max ( var_4 [ var_6 ] , var_4 [ var_6 - var_5 ] + var_5 )
      return var_1 - var_4 [ - 1 ] * 2
  