Combinations of meeting rooms usable simultaneously
Problem Given a set of meeting rooms, each with a booking interval [start, end], return all combinations of rooms that can be used together without conflict — every subset (size ≥ 2) whose intervals are pairwise non-overlapping. Nailing down what "usable together" means against the example is part of the exercise.
Input / Output
- Input: rooms with intervals, e.g. A:[0,2], B:[1,3], C:[3,5], D:[6,8].
- Output: all conflict-free room combinations.
Constraints
- Fix the overlap convention up front: intervals are half-open, so [1,3] and [3,5] do NOT conflict but [0,2] and [1,3] do (they share [1,2]).
- Output size is exponential in the number of rooms; n is small.
Example
- A:[0,2], B:[1,3], C:[3,5], D:[6,8] → AC, AD, BC, BD, CD, ACD, BCD.
asked …