Fewest coins, any coins
Write fewest_coins(amount, coins) that returns the fewest coins from the
given denominations that add up exactly to amount, using each
denomination as many times as needed. Return -1 if it cannot be made.
amount is zero or more.
fewest_coins(30, [25, 10, 1]) -> 3 (10 + 10 + 10)
fewest_coins(67, [25, 10, 5, 1]) -> 6
fewest_coins(3, [2]) -> -1
fewest_coins(0, [7]) -> 0
The point is to practise a one-dimensional DP table where greedy fails.
def fewest_coins(amount, coins):
...