Company: AT and T
Difficulty: medium
Optimal Process Scheduling with Capacity Constraints A compute cluster must run n jobs, where the i th job has a workload of processSize[i] , for 1 ≤ i ≤ n. The cluster has m machines, each with its own capacity limit; machine i can handle a capacity of capacity[i] (1 ≤ i ≤ m). A machine finishes any single job whose size does not exceed its capacity in exactly 1 second, and it is unable to run a job larger than its capacity at all. A machine may run several jobs back to back, but after finishing one job it must idle for 1 second before starting the next. Different machines can run their jobs at the same time, independently of one another. Determine the least amount of time needed to finish every job, or report -1 if some job can never be scheduled on any machine. Function Description Complete the function getMinimumTime with the following parameters: int processSize[n] : the size of each process int capacity[m] : the capacity of each processor Returns int : the minimum time required t