Company: Amazon_12oct
Difficulty: medium
Query Process Activity Problem Description You are a developer at Amazon evaluating the performance of processing units. There are n processes, where each process i runs from starts[i] to ends[i] (both inclusive). You are given q queries, each defined by three arrays: query_process[j] → the exact number of processes to check. query_start[j] → the start time of the query interval. query_end[j] → the end time of the query interval. For each query j , determine how many seconds within query_start[j] , query_end[j] (inclusive) have exactly query_process[j] processes running. Return an array of size q with the result for each query. Examples Example 1: Input: starts = [0, 1, 2] ends = [2, 10, 9] query_process = [0, 2] query_start = [1, 4] query_end = [10, 9] The following table illustrates the process status over time based on the example input (note: the `starts` and `ends` arrays might lead to a slightly different interpretation of process activity than the table's "Process