Computer scienceProgramming languagesJavaInterview preparationAlgorithms and problem solving techniques

Greedy algorithms

Coin change

Report a typo

You need to solve the "coin change" problem. You have a certain amount of money and you give back change using the least number of coins.

We use the euro currency system, which includes the following coin denominations:
1 cent, 2 cent, 5 cent, 10 cent, 20 cent, 50 cent, 1 euro and 2 euro.

There is an unlimited supply of coins of these denominations. Write down the minimum number of coins to make up the sum 5.75 euros.

Enter a number
___

Create a free account to access the full topic