Company: Ibm_27oct
Difficulty: medium
Calculate Total Execution Time Problem Description Given a list of processes with their start and end times (inclusive), find the total amount of time during which at least one process was running. The function getExecutionTime will take two inputs: int start[] : The start times of the processes int end[] : The end times of the processes The function should return an integer denoting the total time during which at least one process was running. Examples Example 1: Input: n = 2 start = [1, 5] end = [3, 10] Output: 9 Explanation: The table below shows the merged intervals during which at least one process is running. Original Intervals | Merged Interval | Total Time -------------------|-----------------|----------- [1, 3] | [1, 3] | 3 [5, 10] | [5, 10] | 6 Total time = (3 - 1) + (10 - 5) = 2 + 5 = 7. Hence, the answer is 9. Example 2: Input: n = 3 start = [5, 6, 12] end = [9, 13, 13] Output: 7 Explanation: The table below shows the merged intervals during which at least one process is ru