Medium · Intervals

Meeting Rooms II

Given an array intervals of meetings [start, end] (start < end) in any order, where a meeting occupies its room during [start, end) so a room freed at time t can host a meeting starting at t, return the minimum number of rooms needed to hold all the meetings.

Examples

Example 1

[[0,30],[5,10],[15,20]] → 2

Output: 2 rooms

Example 2

[[1,5],[2,6],[3,7],[8,9]] → 3

Output: 3 rooms

Rebuild it in the studio

Read every interview problem free. Ten rooms need no account. A token opens a problem in full — Pro never counts.

More Intervals problems