Meeting Rooms II
Updated
Problem statement
You are given meeting time intervals where each row [start, end] uses a half-open interval: a meeting occupies a room from start up to, but not including, end.
Return the minimum number of meeting rooms required so that every meeting can take place. A room whose meeting ends at time t may be reused by another meeting that starts at time t.
Function
minMeetingRooms(intervals: int[][]) → intExamples
Example 1
intervals = [[0,30],[5,10],[15,20]]return = 2The meeting [0,30] overlaps both shorter meetings, but the two shorter meetings do not overlap each other.
Example 2
intervals = [[7,10],[2,4]]return = 1The meetings are disjoint, so one room can host both.
Example 3
intervals = [[1,5],[5,9],[5,6]]return = 2The room used by [1,5] is available at time 5, while the two meetings beginning at 5 need two rooms together.
Constraints
0 <= intervals.length <= 100000.- Each interval has exactly two integers
[start, end]. 0 <= start < end <= 10^9.
More Chainalysis interview questions
- Meeting RoomsPHONE SCREEN · Seen Apr 2025
- Block Transaction Count TrendsONSITE INTERVIEW · Seen Mar 2025
- Filter Team A LogsONSITE INTERVIEW · Seen Mar 2025
- Filter Team A Transfer LogsONSITE INTERVIEW · Seen Mar 2025
- High-Severity Counts by Search TypeONSITE INTERVIEW · Seen Mar 2025
- Team A High-Severity Transfer HashesONSITE INTERVIEW · Seen Mar 2025
- Course Schedule IIOA · Seen Nov 2022
- Longest Common SuffixOA · Seen Nov 2022
Similar questions at other companies
- Mutual-Friend RecommendationsMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions
- Top K Frequent ElementsAmazon · OA · PHONE SCREEN
- Tennis Court SchedulingAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
- Maximum Number of Events That Can Be AttendedByteDance · PHONE SCREENByteDance interview questions
- Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
- Select the Top User MatchesDuolingo · PHONE SCREENDuolingo interview questions
- Meeting Rooms IIQuince · PHONE SCREENQuince interview questions
- Kth Largest Element in an ArrayLinkedIn · PHONE SCREENLinkedIn interview questions
- Meeting Rooms IISecuronix · PHONE SCREEN
- Merge Multiple Sorted StreamsNVIDIA · PHONE SCREENNVIDIA interview questions