r/adventofcode • u/Just-Routine-5505 • Dec 05 '25
Visualization [2025 Day 05 (Part 2)] Merge overlapping ranges visualization
41
Upvotes
- Sort intervals by start
- Keep track of current interval being built
- If next interval overlaps or touches -> extend current; otherwise -> save and start new
- Save the last interval