Coin Change II
Let's solve the Coin Change II problem using Dynamic Programming.
Statement
Suppose you are given a list of coins and a certain amount of money. Each coin in the list is unique and of a different 0
.
Note: You may assume that for each combination you make, you have an infinite number of each coin. In simpler terms, you can use a specific coin as many times as you want.
Let's say you have only two coins,
3 coins of
cents: . 1 coin of
cents and 1 coin of cents:
Constraints:
1 <=
coins.length
<= 5001 <=
coins[i]
<= 5000All the coins have a unique value.
0 <=
amount
<= 5000
Examples
Let's see a few more examples to get a better understanding of the problem statement:
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.