Enumerate Compatible Meeting Subsets
Updated
Problem statement
Meeting i has a unique labels[i] name and interval intervals[i]=[start,end]. Return every subset of at least two meetings that can all use one room without overlap.
A meeting ending when another starts is compatible. Equivalently, intervals are half-open [start,end). Return each subset with labels in ascending ASCII order. Order subsets by increasing size, then lexicographically by their label lists.
Function
compatibleMeetings(labels: String[], intervals: int[][]) → String[][]Examples
Example 1
labels = ["A","B","C","D"]intervals = [[0,2],[1,3],[3,5],[6,8]]return = [["A","C"],["A","D"],["B","C"],["B","D"],["C","D"],["A","C","D"],["B","C","D"]]A and B overlap, so no returned subset contains both. B and C touch at time 3 and are compatible.
Example 2
labels = ["Z","A"]intervals = [[2,3],[0,2]]return = [["A","Z"]]The meetings touch at time 2. Label order in the returned subset is A,Z, independent of input order.
Constraints
0 <= labels.length, intervals.length <= 8.- labels and intervals have equal lengths.
- Every label has length 1.
- Labels are distinct uppercase English letters.
- Every interval row has exactly 2 entries.
0 <= every interval entry <= 1000000.- Every interval start is strictly smaller than its end.
More Expedia Onsite Interview questions
- Scramble StringONSITE INTERVIEW · Seen Sep 2026
- Smallest Sufficient TeamONSITE INTERVIEW · Seen Sep 2026
- Check Anagram Pairs Index by IndexONSITE INTERVIEW · Seen Oct 2025
- Fresh Oranges Left After Rotting StopsONSITE INTERVIEW · Seen Oct 2025
- Longest Increasing SubsequenceONSITE INTERVIEW · Seen Oct 2025
- Lowest Common Ancestor with Repeated and Missing ValuesONSITE INTERVIEW · Seen Oct 2025
- Shortest Substring with Exactly K OnesONSITE INTERVIEW · Seen Oct 2025
- Middle Element of a Linked ListONSITE INTERVIEW · Seen Nov 2024
- Minimum in a Rotated Sorted ArrayONSITE INTERVIEW · Seen Sep 2024
- Mirror Image Binary TreesONSITE INTERVIEW · Seen Sep 2024
Similar questions at other companies
- Bounded Combination Sum with Signed CandidatesConfluent · ONSITE INTERVIEWConfluent interview questions
- Enumerate Character Paths to a MarkerTesla · ONSITE INTERVIEWTesla interview questions
- Subsets IIBloomberg LP · ONSITE INTERVIEWBloomberg LP interview questions
- Generate Circular Student ArrangementsAmazon · ONSITE INTERVIEW
- Partition into Equal-Sum GroupsPalo Alto Networks · ONSITE INTERVIEWPalo Alto Networks interview questions
- PermutationsEPAM · PHONE SCREENEPAM interview questions
- Combination Sum with Single-Use ValuesPinterest · PHONE SCREENPinterest interview questions
- Combination Sum with Unlimited ReuseNVIDIA · PHONE SCREENNVIDIA interview questions
- Sort by Checking PermutationsMercor · PHONE SCREENMercor interview questions
- Enumerate Valid Clock TimesMicrosoft · OAMicrosoft interview questions
Interview reports that mention this question
Expedia interview experiences
- Expedia Intern Final Round in 2021: 28 Experiences (Part 4 of 6)
- Expedia Intern Finals Before 2020: 14 Experiences (Part 6 of 6)
- Expedia Intern Final Round in 2020: 24 Experiences (Part 5 of 6)
- Expedia Intern Final Round in 2022: 15 Experiences (Part 3 of 6)
- Expedia Intern Final Round in 2023: 17 Experiences (Part 2 of 6)