little strokes fell great oaks.
Backpack with Value array: note that: "Each item may only be used once" function: dp[i][j] += dp[i - 1][j - nums[i - 1]]; (when you take that ith item) or dp[i][j] += dp[i - 1][j]; (when you don't take that ith item)
No comments:
Post a Comment