Company: Factset_20nov
Difficulty: medium
Load Balancer Problem Description A load balancer owns n identical servers, numbered 1 to n , and must handle m requests. Request i arrives at time arrival[i] and needs burstTime[i] time units of work. The balancer processes the requests in arrival order ; when several requests arrive at the same time, they are handled in the order of their original indices in the input. When a request arrives, the balancer looks at the servers that are free at that instant and gives the request to the free server with the lowest index . That server is then busy for the half-open interval [arrival[i], arrival[i] + burstTime[i]) : it is busy from the arrival time up to, **but not including**, the finish time, so a server that finishes at time t is free again for a request that arrives at time t . If no server is free when a request arrives, that request is dropped and its answer is -1 . A dropped request never occupies a server and never comes back. Complete the function getServeIndex(n, m, arrival, bur