What should the dry run track?
Practice this question from 0/1 Knapsack - Capacity DP Pattern Practice Quiz, with options and an explanation.
Question
What should the dry run track?
Option A — Correct answer
Track dp[capacity] after each item.
Option B
Only the final answer, not the state transition
Option C
The alphabetical order of variable names
Option D
Only whether input contains duplicates
Explanation
Track dp[capacity] after each item.