Mental Model
Intervals represent ranges of values that often overlap or need merging, making them a common pattern in problems involving scheduling or grouping.
Analogy: Imagine booking meeting rooms where each meeting has a start and end time; overlapping meetings need to be managed carefully to avoid conflicts.
Time line: |----|----|----|----|----|----|----|----| 1 2 3 4 5 6 7 8 Intervals: [1,3] -> === [2,5] ===== [6,8] ===
