Meeting Rooms III: Most Booked Room
Problem statement
You are given an integer n. There are n meeting rooms numbered from 0 to n - 1.
You are also given a 2D integer array meetings, where meetings[i] = [start, end] means a meeting is scheduled for the half-open time interval [start, end). All start values are different.
Meetings are given rooms by these rules:
The problem statement continues
ProExamples
Example 1
n = 3meetings = [[0,30],[1,4],[2,5],[3,6],[7,9]]return = 1- Meeting
[0,30]takes room0,[1,4]takes room1, and[2,5]takes room2. - At time
3every room is busy, so[3,6]waits. Room1frees up first, at time4, so the meeting runs in room1during[4,7). - At time
7, rooms1and2are both unused. Meeting[7,9]takes the lower number, room1. - Room
1held3meetings, while rooms0and2held1each.
FastPrep Pro
Reported in 1 Google interview this weekUnlock this recently reported problem
FastPrep Pro gives you full access to interview problems reported within the last week.
- Full problem statement and constraints
- 2 more worked examples, explained
- Guided hints and editorial
- Run your code on real test cases
$8.25/month
$99 billed yearly — or $19 month-to-month. Cancel anytime.
Free plan — 2 of 2 free unlocks used this week