Solve LeetCode 322: Coin Change. You have coin denominations. Find the minimum number of coins to make a target amount, or return 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 instead of . Take time to work through examples. The pattern becomes clearer with practice. Think about what state you need. How do you track both which coins you have used and what amount remains?