Dodomeki
Sign in

85. Meeting Rooms

Medium

Each meeting is represented by [início, fim]. A meeting that ends at a given time frees the room for another meeting that starts at exactly that time. Return the minimum number of rooms needed to hold all meetings.

Example 1
Input: reunioes = [[0, 30], [5, 10], [15, 20]]
Output: 2
Example 2
Input: reunioes = [[1, 4], [4, 7], [7, 9]]
Output: 1
Constraints
  • 0 <= reunioes.length <= 10^4
  • 0 <= início < fim <= 10^9
IntervalsHeapGreedy
Caso 1
reunioes =
[[0,30],[5,10],[15,20]]
Expected =
2
Caso 2
reunioes =
[[1,4],[4,7],[7,9]]
Expected =
1

Run checks these 2 cases. Submit runs all 6, including hidden ones.