Company: JPMorgan Chase
Difficulty: medium
Minimum Cores for Processes Problem Description CPU scheduling algorithms are used to efficiently manage the execution of processes. A core can handle one process at a time, but CPUs often have multiple cores. Given n processes, where the i -th process starts at start[i] and finishes at end[i] (both inclusive), determine the minimum number of cores needed to handle all processes. Complete the function getMinCores in the editor with the following arguments: int start[n] : the start times of processes int end[n] : the end times of processes Returns: int : the minimum number of cores required Examples Example 1: Input: n = 3 start = [1, 3, 4] end = [3, 5, 6] Output: 2 Explanation: If the CPU has only one core, the first process starts at 1 and ends at 3. The second process starts at 3. Since both processes need a processor at 3, they overlap. There must be more than 1 core. If the CPU has two cores, the first process runs on the first core from 1 to 3, the second runs on the second core f