Line Sweep for Max Overlap
Count concurrent intervals with events.
The Max Overlap Question
How many intervals cover the same moment at once? The peak count is the maximum overlap, the busiest point on your timeline. 📈
Think in Events
Stop thinking about whole intervals. Split each one into two events: a +1 when it starts and a -1 when it ends.
All lessons in this course
- Sort Intervals by Start
- Merge Overlapping Intervals
- Line Sweep for Max Overlap
- Minimum Removals for No Overlap