Problem · Intervals
Merge Intervals
Learn this problemProblem statement
Given a collection of time intervals [start, end], merge and return the overlapping intervals sorted in ascending order of their start times.
Function
getMergedIntervals(intervals: int[][]) → int[][]Examples
Example 1
intervals = [[7, 7], [2, 3], [6, 11], [1, 2]]return = [[1, 3], [6, 11]]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]].
Constraints
More JPMorgan Chase problems
- Bitwise XOR SubsequencesOA · Seen Jul 2026
- Array ChallengeOA · Seen Jun 2026
- Minimum Cores to Handle ProcessesOA · Seen Jun 2026
- About ShippingOA · Seen Jun 2026
- Count Dropped RequestsOA · Seen Jan 2026
- Generate Table of ContentsOA · Seen Jan 2026
- Calculate Net ProfitSeen Jun 2025
- Find Total WeightSeen Jun 2025