Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- let firstEmployee = input.shift();
- let secondEmployee = input.shift();
- let thirdEmployee = input.shift();
- let totalPeople = input.shift();
- let totalPeoplePerHour = firstEmployee + secondEmployee + thirdEmployee;
- let totalHour = Math.ceil(totalPeople / totalPeoplePerHour);
- if (totalHour > 3) {
- totalHour += Math.floor(totalHour / 3)
- }
- console.log(`Time needed: ${totalHour}h.`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement