Company: Amazon_25july
Difficulty: medium
Merge Overlapping Times Problem Description A Supply Chain Manager at an Amazon warehouse is reviewing the logs of when trucks arrived at and departed from their warehouse. Please help them with their review by completing the following challenge: Given a collection of time intervals, [start, end] , merge and return the overlapping intervals sorted in ascending order of their start times. Complete the function findOverlappingTimes in the editor below. findOverlappingTimes has the following parameter(s): int intervals[n][2] : the time intervals Returns int[][2] : the merged intervals in sorted order Examples Example 1: Input: intervals = [[7, 7], [2, 3], [6, 11], [1, 2]] Output: [[1, 3], [6, 11]] Explanation: The interval [1, 2] merges with [2, 3] while [7, 7] merges with [6, 11] . There are no more overlapping intervals. The answer is [[1, 3], [6, 11]] . Example 2 (Sample Case 0): Input: 5 2 6 9 2 3 9 11 1 5 14 18 Output: 1 5 6 11 14 18 Explanation: The intervals [2, 3] and [1, 5] merge