Company: Uber_14july
Difficulty: medium
Request Handling Maximization Problem Description In a distributed API system, n endpoints manage incoming traffic with capacities represented by the array endpointCapacity . Each endpoint receives a specific number of requests given by incomingTraffic , which may exceed its capacity, leading to performance issues. To address this, the development team can optimize the system by doubling the capacities of up to k endpoints. Any one endpoint can only be doubled once. Implement a function to determine the maximum total requests that can be processed by all endpoints after optimizing the system. The function getMaxRequests takes the following inputs: int endpointCapacity[n] : the capacity of each API endpoint int incomingTraffic[n] : the incoming requests for each endpoint int k : the number of endpoints whose capacities can be doubled The function should return the maximum total requests that can be handled after doubling the capacities of up to k endpoints. Examples Example 1: Input: n