Efficient technique to deal with overlapping intervals.
Mechanism
- Given two intervals (
aandb), there will be six different ways the two intervals can relate to each otheraandbdon’t overlap,bends afteraaandboverlap,bends afteraacompletely overlapsbaandboverlap,aends afterbbcompletely overlapsaaandbdon’t overlap,aends afterb

When to use
- If you hear the term “overlapping intervals”.
- Merge intervals if they overlap
- If you’re asked to produce a list with only mutually exclusive intervals