Question: Given an infinite supply of coins of different denominations and a total amount of money, write a function to compute the fewest number of coins

  • Given an infinite supply of coins of different denominations and a total amount of money, write a function to compute the fewest number of coins needed to make up that amount. If it’s not possible to make up that amount, return -1. Implement this in a language of java dynamic programming for efficiency.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public class CoinChange public ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!