Algorithms & Data Structures
Intermediate
Pro
Intervals
Merge, intersect, and count overlaps by sorting endpoints instead of comparing every pair
25 min read
27 views
Learn the interval pattern for problems that describe ranges on a number line: merging overlapping ranges, intersecting two range lists, and finding the maximum number of ranges active at once. Covers sorting-by-start and sweep-line event-counting techniques through three classic interview problems.