algorythms
Merge Intervals
LC #252Easy

Meeting Rooms

Merge Intervals
AmazonGoogleMetaBloombergMicrosoft

Problem

Given an array of meeting time intervals, determine if a person can attend all meetings.

arraysortingmerge-intervals

Constraints

  • 0 ≤ n ≤ 10⁴
  • 0 ≤ startᵢ < endᵢ ≤ 10⁶

Example

Inputintervals = [[0,30],[5,10],[15,20]]
Outputfalse
Why

[0,30] overlaps with [5,10] — impossible to attend both

Hints — reveal one at a time