Beta
Ferris Wheel Cabins
57Tiarama
Description:
Challenge: The lockdown has ended and a group of friends want to take their families to the fairground.
They all want to ride on the main attraction: the ferris wheel!
__ __
__ [_|]'_|] __
[_|].-'-_-_'-._]
_.'.'-.-'' '-.-'__
[_|]-.'. ' ' .'.-_]
_/ /_/ '.'. ' ' . .' -_
[_|]_' '.'_'_. .' '._]
|_|_| = = (.-_o) = = :-_'
[_|] _ .//\/_\. .-_]
\_\_\ .'//_//_\\'. .-.
[_|]_`./.-/.-.-.\_'-_]
'.'.-'-//__.\.\\.'
[_|]-/.-_ .-[_\\
// // [_|] \.\\
_____//_//_________\.\\_____ wheeeee!
However, there are some conditions:
Each cabin on the ferris wheel can hold up to 3 people, and each cabin must have at least 1 adult.
They all want to ride at the same time and don't want to leave anybody out, otherwise they wont ride at all.
Let's pretend the ferris wheel has an infinite number of cabins available.
Task:
Given two integers as arguments (number of adults, number of children) return the mininum number of cabins needed for the group to ride, otherwise return -1 if they decide not to ride at all.
Algorithms
Similar Kata:
Stats:
Created | Apr 1, 2021 |
Published | Apr 1, 2021 |
Warriors Trained | 132 |
Total Skips | 30 |
Total Code Submissions | 310 |
Total Times Completed | 57 |
JavaScript Completions | 57 |
Total Stars | 3 |
% of votes with a positive feedback rating | 77% of 37 |
Total "Very Satisfied" Votes | 25 |
Total "Somewhat Satisfied" Votes | 7 |
Total "Not Satisfied" Votes | 5 |
Total Rank Assessments | 38 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |