Level 3 · Structures
Free Intervals lessons
4 lessons, about 39 minutes in all. Each teaches one idea with a visual, then gives you one problem built for it. Read the lessons here, then create a free account to solve the problems and keep your progress.
Stage 0Overlap and merge
- Do they overlap?Two ranges share a point unless one ends before the other begins.7 min
- Merge twoPut the earlier interval first; if the later one starts inside it, join them into one.8 min
- Merge a whole listSort by start, then walk once, either stretching the last merged interval or starting a new one.12 min
- Insert into a sorted listCopy what ends before the new interval, absorb everything it overlaps, then copy the rest.12 min
There’s more after this
These are the opening stages of Intervals. The full path climbs on to harder problems and a mastery test. Create a free account and we’ll keep your place.
Start the full path free