Find Overlapping Times
AMZ Interval Collection (A group of problems focused on operations involving intervals :) -
1. Find Overlapping Times (Intern)
2. Get Maximum Sum Find Overlapping Times (Full-Time)
3. Merge Intervals (Intern, NG)
5. Optimal Interval Difference
At an Amazon warehouse, trucks follow scheduled arrival and departure times. Each truck's timeframe is represented as an interval [arrival, departure], where it marks when the truck entered and exited the facility.
Due to operational overlaps, some intervals may intersect, meaning multiple trucks were at the warehouse at the same time. To simplify the records, overlapping intervals should be merged into a single continuous time block.
Your task is to process a list of time intervals, merge any overlapping ones, and return the final set of intervals sorted in ascending order of arrival times.
Complete the function findOverlappingTimes in the editor.
findOverlappingTimes has the following parameter(s):
int intervals[[n][2]]: the time intervals
Returns
int[][2]: the merged intervals in sorted order
1Example 1
Constraints
Limits and guarantees your solution can rely on.