Meeting Rooms II

Medium · Intervals · Array · Heap · Sorting · Sweep Line

Problem

Given meeting intervals [start, end], return the minimum number of rooms needed so that no two meetings overlap in the same room.

A meeting ending exactly when another begins does not conflict.

Examples

Input: intervals = [[0,30],[5,10],[15,20]]
Output: 2

[0,30] overlaps both others, which do not overlap each other.

Input: intervals = [[7,10],[2,4]]
Output: 1

They do not overlap.

Constraints

Approaches

Related problems

Start free on Cariara · Coding problems · System design studio

Starting Python
No results yet.

          
↑↓ move ↵ open esc close

Labs

Loading labs…

Run with your own input

Starting Python

Loading Python…