Algorithm · JPMorgan · Medium
Requirements Take a collection of intervals and combine every pair or group that overlaps. Produce the consolidated intervals so that none of the returned ranges overlap. The returned list must be ordered by each interval's starting value after merging, following the usual convention. Apply the customary Merge Intervals definition of overlap unless an assessment specifies a different interpretation. Examples Explanation: [2,6] intersects [5,8], so they become [2,8]; [11,13]…
Checking your access…