Advertisement
Spocoman

01. Scheduling

Feb 17th, 2024
824
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function scheduling(input) {
  2.     let jobs = input.shift().split(", ").map(Number), index = Number(input.shift());
  3.        
  4.     console.log(jobs.filter(x => x <= jobs[index]).reduce((a, b) => a + b, 0));
  5.     return;
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement