A beautiful greedy problem that combines last-occurrence tracking with interval merging concepts.
Enable JavaScript for the full StreamPrep guide.