0PricingLogin
Competitive Programming Academy · Lesson

Unbounded & Coin-Change DP

Use items any number of times.

Unlimited Items

In the unbounded knapsack, each item can be taken as many times as you like. Think of coins in a vending machine, not a fixed pile.

The One Tiny Change

Compared to 0/1, only the loop direction flips. For unbounded items you iterate capacity forward, low to high.

All lessons in this course

  1. 0/1 Knapsack: Take or Leave
  2. Space-Optimized Knapsack
  3. Unbounded & Coin-Change DP
  4. Subset Sum & Partition
← Back to Competitive Programming Academy