Skip to content

Coin change

planning ahead

Level 2 of 3

Also called Change-making problem and Fewest coins, by dynamic programming.

Finds the fewest coins that make an amount exactly, any coin used as often as needed. Taking the biggest coin first is not always fewest, so every amount from 0 up is answered in turn, each built from the answers for the amounts a coin less.

the fewest coins for each amount

coins tried
0

step 1 of 1

Examples

Up to 3 different coin values from 1 to 9, separated by commas, then a semicolon and the amount to make, from 1 to 9, for example 1, 3, 4; 6.