EasyIntervals · Sorting

Meeting Rooms

Given meeting times [(start, end), …] in any order, return whether one person can attend all of them without a conflict. Meetings that only touch, like (0,8) and (8,10), don't conflict.

[(0,30),(5,10),(15,20)] → false[(5,8),(9,15)] → true

Try:
CALL
1 / 1

Code

The highlighted line runs next. The pill shows the live values in the running call.

Variables

The data structures the code is building

Number line

One row per meeting

Time and space complexity

n = number of meetings. The highlighted row is the solution being traced.

Keyboard: ← → step, Space play or pause. 0 to 8 meetings as (start,end) pairs with 0 ≤ start < end ≤ 1,000,000.