Dynamic Programming21 sections · 916 units
Open in Course

LeetCode 322 Coin Change - Problem Statement

Apply unbounded

Solve LeetCode 322: Coin Change. You have coin denominations. Find the minimum number of coins to make a target amount, or return 1-1 if impossible. This is unbounded knapsack with a twist: reduce count instead of get the highest value.

Each coin has "value" 1 (the count). The transition uses min\min instead of max\max. Think about what state you need. How do you track both which coins you have used and what amount remains?