Company: Z Scaler
Difficulty: medium
Server Management A company manages a network of n servers to handle incoming requests. Each server can handle a specified number of requests represented by an array, serverCapacity . However, the actual incoming requests for each server, represented by incomingRequests , may exceed the capacity of some servers, leading to potential overload and performance degradation. To optimize load distribution and ensure efficient server utilization, the company plans to double the capacity of any k servers. The task is to determine the maximum total number of requests that can be handled by all the servers after implementing these changes. Function Parameters int serverCapacity[n] : the capacity of each server int incomingRequests[n] : the number of incoming requests for each server int k : the number of servers whose capacity is doubled Returns long : the maximum number of total requests that can be handled by all the servers after modifications Constraints 1 ≤ k ≤ n ≤ 2 × 10 5 1 ≤ serverCapaci