Minimum Time to Execute Processes

Company: Rippling_29march

Difficulty: medium

Problem Statement

Minimum Time to Execute Processes Problem Description There are n processes waiting to run. The i -th process has a size processSize[i] . There are m processors. The j -th processor has a capacity capacity[j] . A processor can run a process only if the size of that process is less than or equal to the processor's capacity; a process larger than the capacity can never be run by that processor. Running one process takes a processor exactly 1 second . A processor may run several processes, but only one at a time, and it must pause for 1 second between two consecutive processes . So a processor that runs k processes is busy for 2 * k - 1 seconds: k seconds of work and k - 1 one-second pauses. (inferred - the source says a processor pauses after completing a process; Example 3 shows a processor running two processes and finishing in 3 seconds, so the pause falls only between consecutive processes and never after a processor's last one.) All processors start at the same moment and work at th