Coin change
MediumGiven an array of coin denominations and a total, find the minimum number of coins that it would take to make up the total.
For example, given the inputs
coins = [1, 2, 5]total = 9
Your function should return
3
since you only need two 2
coins and one 5
coin to make the total 9
.(2 * 2) + (1 * 5) = 9
Solution
8 Essential Recursion & Dynamic Programming Coding Interview Problems
Master Recursion & Dynamic Programming by trying the coding challenges below.
- 1.FibonacciEasy
- 2.Unique pathsMedium
- 3.KnapsackMedium
- 4.Subset sumMedium
- 5.Power setMedium
- 6.Coin changeMedium
- 7.Word breakHard
- 8.Longest common subsequenceHard