Company: Wayfair
Difficulty: medium
Maximize CPU Utilization A number of tasks need to be distributed among servers. All tasks are assigned to their first server until it reaches capacity. They want to utilize the CPU as much as possible. Determine the maximum units of capacity the first server can process. Any process is only run once. Input Format The function maximizeCPU has two parameters: int requirements[n] : the processing requirements of each task processingCapacity : the available processing capacity Output Format Return an integer: the maximum processing requirements that can be served Constraints 1 ≤ n ≤ 42 1 ≤ processingCapacity ≤ 10 9 1 ≤ requirements[i] ≤ 10 9 Examples Example 1: Input: requirements = [15, 12, 3, 7, 8] processingCapacity = 18 Output: 18 There are two groups that sum to processingCapacity = 18: [15, 3] [8, 7, 3] Either group requires full capacity, which is the perfect solution. Return 18. Sample Case 0: Input: requirements[] size n = 3 requirements[] = [2, 9, 7] processingCapacity = 15 Outp