9. Coins

Difficulty: 

Calculate the minimum number of coins needed to change a given amount of money. For the purpose of this problem, the coin nominations are 1, 2, 5, 10, and 25 cents.

Input:

changeCoins(8);

Output:

3

Time Limit:

500 (ms)

Hint (hover to see):

  • Hint #1



Results

ProblemsAcceptedWrongTimed OutError
160000

Input:

Expected Output:

Output: