Company: Atlassian_24july
Difficulty: medium
Round-Robin Load Balancing Problem Description Implement a prototype round-robin load-balancing algorithm for n servers numbered 1 to n , handling m requests. Each request i arrives at time arrival[i] and takes burstTime[i] to execute. The load balancer assigns each request to the available server with the lowest index. A server becomes unavailable from the arrival time until completion ( arrival[i] + burstTime[i] ). If multiple requests arrive simultaneously, they are processed in order of their original indices. If no server is available when a request arrives, it is dropped (-1). For each request, return the 1-based index of the server that processes it or -1 if dropped. Function Description Complete the function getServerIndex in the editor with the following parameter(s): int n : the number of servers int arrival[m] : the arrival time of requests int burstTime[m] : the burst time of requests Returns int[m] : the 1-based index of the servers the requests are assigned to, or -1 if n