In many dp, such as knapsack, there is a often a state dp[i][...] such that i is first i numbers. Why is that? Why might it be so convenient for such a state?
In DP, why state 'First i numbers' so common?
In many dp, such as knapsack, there is a often a state dp[i][...] such that i is first i numbers. Why is that? Why might it be so convenient for such a state?