Challenge: Make a Change Machine
Given infinite quarters, dimes, nickels, and pennies, calculate the minimum number of coins to represent a collection of amount ”C.” Propose a solution to test your skills in Java!
We'll cover the following
A change machine is a kind of vending machine that accepts large amounts of currency and returns an equal amount of currency in smaller bills or coins.
Problem statement
You have to make such a change machine that only returns the change in the form of .
You are supplied with an infinite number of quarters , dimes , nickels , and pennies . The user will enter any amount. For each amount, you have to return the minimum number of coins possible!
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.