Cody

Problem 1240. Coin change combinations.

  • Created by Ken

Using only pennies (1), nickels (5), dimes (10), quarters (25), half dollars (50), and dollars (100), how many different combinations can be made from a given amount in cents.

Example 1:

>>change(17)

%Output will be the the number of combinations of coins to make 17 cents.

c =

   6 

There are 6 combinations:

17 pennies

12 pennies and 1 nickel

7 pennies and 2 nickels

2 pennies and 3 nickels

7 pennies and 1 dime

2 pennies, 1 nickel, and 1 dime.

Example 2:

>>change(100)

c =

    293

Solution Stats

61.36% Correct | 38.64% Incorrect
Last solution submitted on Sep 13, 2019

Problem Comments

Solution Comments