Code RoomMeeting room assignment
HardPrep Room Coding #1218

Meeting room assignment

CodingAlgorithms & data structuresSenior–Staff~35 min

You have `n` meeting rooms numbered 0..n-1 and a list of `meetings` where meetings[i] = [start, end] (half-open, end exclusive, all starts distinct). Process meetings in start order. Each meeting is assigned the lowest-numbered free room. If no room is free, it waits and takes the room that frees up earliest (ties broken by lowest room number); a delayed meeting keeps its original duration. Return the room that held the most meetings (lowest number on a tie). 1 <= n <= 100, up to 10^5 meetings.

Implement
most_booked(n: int, meetings: list[list[int]]) → int
Examples
in[2,[[0,10],[1,5],[2,7],[3,4]]]out0
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 35 min
InputExpectedGot
[2,[[0,10],[1,5],[2,7],[3,4]]]0not run yetsample