Company: jpmc_9aug
Difficulty: medium
Minimum Cores for CPU Scheduling 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. Examples Example 1: Input: n = 3, start = [1, 2, 3], end = [3, 3, 5] Output: 3 Explanation: Using 2 cores, the first and second processes finish at time 3. The third process starts at 3. Given the conflict, there must be at least 1 more core. Example 2: Input: n = 3, start = [1, 4, 7], end = [2, 4, 10] Output: 1 Explanation: Using 1 core, processes run from 1 to 2, from 4 to 4, and from 7 to 10. There are no conflicts. Constraints 1 <= start[i] <= end[i] <= 10 9 start.length == end.length The number of processes, n , is start.length . The function signature is provided as: #include <bits/stdc++