Practice/Google/Car Rental Optimization
CodingMust
You are building a conference room scheduling system. Given a list of meeting requests, each specified by a start time, end time, and unique meeting ID, assign each meeting to a conference room using the minimum number of rooms possible.
A meeting occupies a room from its start time up to (but not including) its end time. Two meetings can use the same room if one ends exactly when the other starts.
Return a dictionary/object mapping each meeting ID to its assigned room number. Room numbers should start from 0 and be assigned sequentially as needed.
Example 1:
` Input: meetings = [[0, 30, 1], [15, 45, 2], [50, 70, 3]] Output: {1: 0, 2: 1, 3: 0} Explanation:
Example 2:
` Input: meetings = [[0, 10, 101], [10, 20, 102], [20, 30, 103]] Output: {101: 0, 102: 0, 103: 0} Explanation:
Example 3:
` Input: meetings = [[0, 100, 1], [10, 50, 2], [20, 60, 3], [30, 40, 4]] Output: {1: 0, 2: 1, 3: 2, 4: 3} Explanation: