Company: Nutanix_17july
Difficulty: medium
Optimize Server Load Problem Description A data center wants to optimize the workload distribution to its servers. You are responsible for assigning a subset of tasks to Server A so that its CPU is used as much as possible without exceeding its processing limit. Each task has a fixed CPU requirement. A task is either assigned to Server A as a whole or not assigned at all: it cannot be split, and it can be assigned at most once. The order in which tasks are listed does not matter. Your objective is to choose a combination of tasks that maximizes the total CPU load on Server A without exceeding cpuLimit , and to return that maximum total load. Function Description Complete the function optimizeServerLoad in the editor. optimizeServerLoad has the following parameters: taskLoads[n] : an array where each element is the CPU requirement of one task cpuLimit : the total CPU processing limit of Server A Returns a 64-bit integer: the maximum total load Server A can handle without exceeding cpuLi