Unbounded Knapsack
Signals to notice
Brute force first
Try all possible quantities of each item — exponential without memoization. That direct path helps you understand the question, but it tends to treat every possibility as brand new instead of learning from earlier steps.
The key insight
1D DP: dp[w] = max value achievable with capacity w. For each capacity from 1 to W, try every item: dp[w] = max(dp[w], dp[w-weight[i]] + value[i]). The goal is not to be clever for its own sake, but to remember the one relationship that keeps the solution grounded as you move forward.
What must stay true
Unlike 0/1 knapsack, processing left-to-right in the 1D array ALLOWS reuse — dp[w-weight[i]] may already include item i, and that's correct for unbounded. If that remains true after every update, the rest of the reasoning has a stable place to stand.
Easy way to go wrong
Processing right-to-left like 0/1 knapsack — that prevents reuse. For unbounded, process LEFT-to-RIGHT so items can be picked multiple times. The fix is usually to return to the meaning of each move, not just the steps themselves.