Ad
  • Custom User Avatar
  • Custom User Avatar

    The thought of this solution is simple.

    1. An array is needed to record the total waiting time for each window.
    2. To process the waiting queue, take the first item from the queue each time. For each item, look for the window with the least total processing time, and then add the processing time for that item to that window.
    3. Repeat the steps above until the waiting queue is empty. Return the maximum value of the array we created at step 1.

    Hope it clarified. :)