← 返回 salesforce 的题目列表Minimum Meeting Rooms Required with Capacity Constraints
类型:online_judge
salesforce
Given a list of time intervals representing the start and end times of different meetings and the maximum capacity of each meeting room, calculate the number of rooms needed to accommodate all meetings.
Input: A list of intervals where each interval[i] = [start_i, end_i] represents the start and end time of meeting i. Also, include the maximum capacity of each meeting room.
Output: Number of rooms needed.
Example:
Input: intervals = [[0, 30],[5, 10],[15, 20]], max_capacity = 10
Output: 2
Constraints:
Interval list size range: 0 <= intervals.length <= 10^4
Time range: 0 <= start_i < end_i <= 10^6
Maximum capacity 1 <= max_capacity <= 10^4
Example
Input
[[0, 30],[5, 10],[15, 20]],10