Advertisement
Guest User

01.National Court

a guest
May 25th, 2021
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(input) {
  2.     let efficiencyOne = Number(input[0]) // count of people emplyee one can help per hour
  3.     let efficiencyTwo = Number(input[1]) // count of people emplyee two can help per hour
  4.     let efficiencyThree = Number(input[2]) // count of people emplyee three can help per hour
  5.     let peopleCount = Number(input[3]) // total count of people
  6.     let customersPerHourTotal = efficiencyOne+efficiencyTwo+efficiencyThree
  7.     let hoursNeeded = Math.round(peopleCount/customersPerHourTotal)
  8.     let totalHoursWorked = 0;
  9.     for(let i = 0;i<hoursNeeded; i++){
  10.        if(i%4==0){
  11.            totalHoursWorked++
  12.        }
  13.        totalHoursWorked++
  14.     }
  15.     console.log(`Time needed: ${totalHoursWorked}h.`)
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement