Algorithm · IBM · Medium
Requirements Function: getExecutionTime(start, end). The inputs are int start[n] and int end[n], with start[i] <= end[i] for every process. Return an integer representing the combined duration covered by one or more running processes. Treat each interval as closed, meaning both its start and end timestamps count. With n as large as 2 * 10^5 and timestamps reaching 10^9, the intended approach is interval merging or a sweep line. Examples The ranges [2,7] and [4,8] combine…
Checking your access…