Server Management

Company: Rippling_23oct

Difficulty: medium

Problem Statement

Server Management Problem Description A company manages a network of n servers to handle incoming requests. Server i can handle at most serverCapacity[i] requests, and incomingRequests[i] requests actually arrive at it. The incoming requests may exceed the capacity of some servers, leading to overload: a server handles min(serverCapacity[i], incomingRequests[i]) of its own requests, and any requests beyond its capacity are dropped. Requests never move from one server to another. To optimize load distribution, the company plans to double the capacity of any k servers . A doubled server handles min(2 * serverCapacity[i], incomingRequests[i]) requests. Each server can be doubled at most once. Determine the maximum total number of requests that can be handled by all the servers after these changes. Function Description Complete the function getMaxRequests . Parameters: serverCapacity (int[n]): the capacity of each server. incomingRequests (int[n]): the number of incoming requests for each