Merge overlapping bookings

A code exercise of about 20 minutes: read the statement, solve «Merge overlapping bookings» in the browser and get a review like in a real interview.

Code · 20 min
Loading…

Statement

Write mergeIntervals(intervals): each interval is [start, end]. Merge the ones that overlap or touch ([1, 3] and [3, 5] give [1, 5]) and return them sorted by start.