Practice / Software

Merge overlapping intervals

Medium · Coding (typed)

Given a list of intervals [start, end], merge all overlapping ones. [[1,3],[2,6],[8,10],[15,18]] becomes [[1,6],[8,10],[15,18]]. Decide whether [1,4] and [4,5] overlap and say why.

Create a free account to answer it and get scored on what a strong answer covers.