Liliana797979

national court - mid exam fundamentals

May 23rd, 2021
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function nationalCourt([emp1, emp2, emp3, pplCount]) {
  2.  
  3.   let pplServed = pplCount;
  4.   let timeNeeded = 0;
  5.  
  6.   while (pplServed > 0) {
  7.     timeNeeded++;
  8.  
  9.     if (timeNeeded % 4 === 0) {
  10.       continue;
  11.     }
  12.  
  13.     pplServed -= emp1;
  14.     pplServed -= emp2;
  15.     pplServed -= emp3;
  16.  
  17.   }
  18.   console.log(`Time needed: ${timeNeeded}h.`);
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment