6 kyu
Simple Fun #165: Withdraw
576 of 1,713myjinxin2015
Description:
Task
An ATM
ran out of 10 dollar bills and only has 100, 50 and 20
dollar bills.
Given an amount between 40 and 10000 dollars (inclusive)
and assuming that the ATM wants to use as few bills as possible, determinate the minimal number of 100, 50 and 20 dollar bills the ATM needs to dispense (in that order).
Example
For n = 250
, the result should be [2, 1, 0]
.
For n = 260
, the result should be [2, 0, 3]
.
For n = 370
, the result should be [3, 1, 1]
.
Input/Output
[input]
integern
Amount of money to withdraw. Assume thatn
is always exchangeable with[100, 50, 20]
bills.[output]
integer array An array of number of100, 50 and 20
dollar bills needed to complete the withdraw (in that order).
Puzzles
Similar Kata:
Stats:
Created | Feb 24, 2017 |
Published | Feb 24, 2017 |
Warriors Trained | 4187 |
Total Skips | 222 |
Total Code Submissions | 9515 |
Total Times Completed | 1713 |
JavaScript Completions | 464 |
Python Completions | 576 |
Elixir Completions | 80 |
Crystal Completions | 7 |
Ruby Completions | 82 |
PHP Completions | 70 |
Java Completions | 326 |
C# Completions | 155 |
COBOL Completions | 5 |
C Completions | 55 |
Julia Completions | 5 |
Total Stars | 99 |
% of votes with a positive feedback rating | 93% of 348 |
Total "Very Satisfied" Votes | 309 |
Total "Somewhat Satisfied" Votes | 32 |
Total "Not Satisfied" Votes | 7 |
Total Rank Assessments | 12 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |