Roadmap › Stage 9: Greedy & Dynamic Programming › Pattern 41 of 53
DSA pattern guide
Greedy — Intervals
Merge, insert or remove overlapping intervals, jump reachability.
Use it when
Merge, insert or remove overlapping intervals, jump reachability.
Key idea
Sort by start (merge) or end (max non-overlapping) and decide locally, one interval at a time.
Practice problems, in order
- Merge IntervalsMedium
- Insert IntervalMedium
- Non-overlapping IntervalsMedium
- Minimum Arrows to Burst BalloonsMedium
- Jump GameMedium
- Jump Game IIMedium
- Car PoolingMedium
- Min Taps to Water GardenHard
How to practise this pattern
- Read the problem and look for the signal above before writing any code.
- Say the brute force out loud, with its time complexity, then ask what work it repeats.
- Apply the key idea and write the optimised version yourself.
- If you're stuck for more than 10 minutes, take one small hint, not the full solution.
- Move to the next problem only when you can explain why this pattern fits.
Stuck on one of these?
The AlgoSolveo extension (free, launching soon) sits beside the LeetCode problem and gives the smallest hint that gets you moving, never the full answer. Solved problems tick off on your roadmap.
Join the extension waitlistTrack it on the roadmap