6 kyu
How Many Reindeers?
493 of 1,655BattleRattle
Description:
Santa puts all the presents into the huge sack. In order to let his reindeers rest a bit, he only takes as many reindeers with him as he is required to do. The others may take a nap.
Two reindeers are always required for the sleigh and Santa himself. Additionally he needs 1 reindeer per 30 presents. As you know, Santa has 8 reindeers in total, so he can deliver up to 180 presents at once (2 reindeers for Santa and the sleigh + 6 reindeers with 30 presents each).
Complete the function reindeers()
, which takes a number of presents and returns the minimum numbers of required reindeers. If the number of presents is too high, throw an error.
Examples (input -> output / error)
0 -> 2
1 -> 3
30 -> 3
200 -> throws an error
Algorithms
Similar Kata:
Stats:
Created | Dec 15, 2013 |
Published | Dec 15, 2013 |
Warriors Trained | 2183 |
Total Skips | 116 |
Total Code Submissions | 5040 |
Total Times Completed | 1655 |
JavaScript Completions | 493 |
CoffeeScript Completions | 60 |
Ruby Completions | 353 |
Python Completions | 807 |
Total Stars | 18 |
% of votes with a positive feedback rating | 86% of 242 |
Total "Very Satisfied" Votes | 186 |
Total "Somewhat Satisfied" Votes | 46 |
Total "Not Satisfied" Votes | 7 |
Total Rank Assessments | 6 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |