04.07 · Lesson
Unlimited Supply: Coin Change
Change one rule from the last lesson: each item can be used any number of times. Now taking item i keeps you on i, because you may take it again.
| Take | Skip | |
|---|---|---|
| Each item once | f(i + 1, rem − w[i]) | f(i + 1, rem) |
| Unlimited supply | f(i, rem − w[i]) | f(i + 1, rem) |
That’s the whole difference. The state and the memo size stay the same.
solulu Pro
Continue this lesson with Pro
Inside: 3 sections · 2 videos · quiz.
- Try it
- Fewest coins
- Number of ways
Lifetime ₹1,999 ₹999 · Launch offer
Item 33 of 44 · updated 2026-10-13