Please, drink responsibly!
Description:
A company of students is going to spend their free time wisely. All they have to decide is what should they buy today: vodka or beer?
Write a function that will help these guys to have a good time as many days in a row as possible and save as much money as possible too! Days amount is always a priority here!
If they can't afford even 1 good day, return 'BUMMER!'
Every single student needs no less than 1 vodka/day OR 8 beers/day. 1 vodka costs 30$, and 1 beer — only 4$. BUT! If they've got enough money to buy at least (>=) 2 cases of beer (24 beer in each), they have a super-beer-discount, and one beer costs only 3$!
You may assume that there will always be an input, it will always be a number, number of people is more than 0, and at least one of the students is above 21.
Example:
drinkResponsibly(5, 180)) => 'VODKA!'
// Vodka case: 5 * 30 = 150$ => 1 good day and 30$ left.
// Beer case: 5 * (4 * 8) = 160$ => 1 good day and 20$ left.
drinkResponsibly(5, 360)) => 'BEER!'
// Vodka case: 5 * 30 * 2 = 300$ => 2 good days and 60$ left.
// Beer case: 5 * (3 * 8) * 2 = 360$ => 3 good days and 0$ left.
Similar Kata:
Stats:
Created | Mar 27, 2022 |
Warriors Trained | 30 |
Total Skips | 0 |
Total Code Submissions | 141 |
Total Times Completed | 15 |
JavaScript Completions | 15 |
Total Stars | 0 |
% of votes with a positive feedback rating | 55% of 11 |
Total "Very Satisfied" Votes | 4 |
Total "Somewhat Satisfied" Votes | 4 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 10 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |