little strokes fell great oaks.
Classic backpack: function: dp[i][j] = dp[i - 1][j]; dp[i][j] = dp[i - 1][j] || dp[i - 1][j - A[i-1]] (if it can fit that ith item, aka: j - A[i-1] >= 0)
No comments:
Post a Comment