Key Patterns to Master
- Interval Sorting: Sorting by end time to maximize non-overlapping events.
- Max Reach: Tracking the furthest possible index.
- Local Optimization: Making the best choice at each step without backtracking.
Hand-Picked Problems
| Problem | Difficulty | Key Pattern |
|---|---|---|
| Assign Cookies | Easy | Simple Greedy |
| Jump Game | Medium | Max Reach |
| Gas Station | Medium | Running Balance |
| Non-overlapping Intervals | Medium | Sorting by End Time |
| Task Scheduler | Medium | Priority Frequency |
| Minimum Number of Arrows to Burst Balloons | Medium | Intervals |
| Two City Scheduling | Medium | Relative Cost |
| Partition Labels | Medium | Last Occurrence |
| Queue Reconstruction by Height | Medium | Sorting + Insertion |
| Candy | Hard | Two-pass Greedy |
Interview Tip
Always be ready to answer: "Why does the Greedy choice work here instead of DP?"