Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- let efficiencyOne = Number(input[0]) // count of people emplyee one can help per hour
- let efficiencyTwo = Number(input[1]) // count of people emplyee two can help per hour
- let efficiencyThree = Number(input[2]) // count of people emplyee three can help per hour
- let peopleCount = Number(input[3]) // total count of people
- let customersPerHourTotal = efficiencyOne+efficiencyTwo+efficiencyThree
- let hoursNeeded = Math.round(peopleCount/customersPerHourTotal)
- let totalHoursWorked = 0;
- for(let i = 0;i<hoursNeeded; i++){
- if(i%4==0){
- totalHoursWorked++
- }
- totalHoursWorked++
- }
- console.log(`Time needed: ${totalHoursWorked}h.`)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement