Skip to content

Greedy

Merge intervals: sort, then sweep

From the Greedy lesson: Take the best-looking move now — when you can prove it's safe.

Step with → or Next. When a question pops up, make your guess. Switch to “Try your own” to run it on your input.

Getting the demo ready…

More from Greedy