Mental Model
Intervals represent ranges of values, like time slots or segments, that often overlap or need merging to solve real problems.
Analogy: Imagine booking meeting rooms where each meeting has a start and end time. You want to know if meetings clash or how many rooms you need.
Time line:
|----|----|----|----|----|----|----|----|
1 2 3 4 5 6 7 8
Intervals:
[1 -> 3]
[2 -> 5]
[6 -> 8]