Problem. Given intervals [start, end], return the minimum number to remove so that no two remaining intervals overlap.
Intervals that only touch ([1, 2] and [2, 3]) do not overlap.
[[1, 2], [2, 3], [3, 4], [1, 3]] → 1 (remove [1, 3])
[[1, 2], [1, 2], [1, 2]] → 2
[[1, 2], [2, 3]] → 0
Removing the fewest is the same as keeping the most: answer = n − (largest set of pairwise non-overlapping intervals). That's the classic interval scheduling problem: one GPU, many jobs with fixed time windows, run as many as possible.
ML context. Fixed-window jobs competing for one machine (training runs with reserved slots, evaluation jobs, batch inference windows) are interval scheduling. When jobs have values (priority, expected gain), the greedy no longer works and the weighted DP takes over (Change A). Temporal action detectors face a related clean-up: overlapping detections of the same event are pruned by non-maximum suppression, which is greedy by score (Change D).