Skip to content

Meeting Rooms

EasyIntervals
Decode it first. Clues, constraints, pattern and plan before any code.

Each meeting is a pair [start, end]. Return true if one person could attend all of them, meaning no two meetings overlap. A meeting that ends at 10 and one that starts at 10 do not clash.

[[0, 30], [5, 10], [15, 20]]  →  false   ([0, 30] overlaps both others)
[[7, 10], [2, 4]]             →  true
[[1, 5], [5, 10]]             →  true    (back to back is fine)

Constraints

  • 0 <= intervals.length <= 10^4
  • 0 <= start < end <= 10^6
  • The input is not sorted.