Given coins of different denominations and a total amount, return the number of combinations to make that amount. You can use each coin unlimited times. For example, with coins and amount , there are ways: . This is unbounded knapsack with counting.
But there's a trap. Notice the problem says "combinations", not "permutations". Using and counts as one way, not two. If you're not careful, your DP will count permutations instead. The fix involves loop order, which trips up a lot of people.