0Pricing
Competitive Programming Academy · Lesson

Minimum Removals for No Overlap

Greedy keep-by-earliest-end scheduling.

The Removal Goal

You have overlapping intervals and want the fewest removals so none overlap anymore. Keep as many as you can. ✂️

Flip the Problem

Removing the fewest is the same as keeping the most non-overlapping intervals. Solve the keep version, then the removals are n minus kept.

All lessons in this course

  1. Sort Intervals by Start
  2. Merge Overlapping Intervals
  3. Line Sweep for Max Overlap
  4. Minimum Removals for No Overlap
← Back to Competitive Programming Academy