Course 05 · Orientation
Optimization
Choose, then reuse
Sort intervals and make the greedy choice you can prove. Then stop recomputing overlapping subproblems: one dimension, then two.
The course journey
Build one family of skills at a time
Each technique is three short lessons, and each one builds on the lesson before it. A lesson walks through one problem step by step, then hands it to you along with a few more to solve on your own.
- 01Start here
Intervals + Greedy
Sort intervals to merge overlaps, sweep their events to count peak load, and commit to the greedy choice that leaves the most room.
- Stage 1Sorting & Merging Overlapping IntervalsSort by start time so overlapping intervals sit adjacent and merge in one scan1 Lesson · 3 Problems
- Stage 2Sweep-Line & Concurrent Peak CountingTrack active intervals by sorting start/end events or maintaining a min-heap1 Lesson · 3 Problems
- Stage 3Greedy Choice by End Time or ReachCommit to the locally optimal choice that leaves the most room for what follows1 Lesson · 3 Problems
- 02Pro
1D DP
One index, a recurrence, a table. Then keep only the cells you still need.
Stage 1
Bottom-Up Tabulation
Stage 2
Include-or-Exclude DP
Stage 3
Unbounded Knapsack
- 03Pro
2D DP
Two indexes: fill grids from their neighbors, align two sequences prefix by prefix, and track reachable sums against a budget.
Stage 1
Grid Path Tabulation
Stage 2
Two-Sequence Alignment (LCS / Edit Distance)
Stage 3
0/1 Knapsack & Target Sum Tables