Skip to content

Latest commit

 

History

History

challenge-33

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Merge Overlapping Intervals

This problem was asked by Microsoft.

Description

You are given an array of intervals - that is, an array of tuples (start, end). The array may not be sorted, and could contain overlapping intervals. Return another array where the overlapping intervals are merged.

Example

Input:  [(1, 3), (5, 8) , (4, 10), (20, 25)]
Output: [(1, 3), (4, 10), (20, 25)]
Explanation: (5, 8) and (4, 10) can be merged into (4, 10)