Advent of Code Speedrunning: 2025, Day 5
When you don't want to reinvent the wheel… Today’s Advent of Code challenge involved calculating the union of massive ranges. Eventually, after a quick search on crates.io, I found a neat little crate, I knew that a Moral of the story: work smarter, not harder.range_union_find, that could allow me to not have to reinvent the wheel. “Implementing” an efficient strategy was as simple as this:
use RangeUnionFind;
Vec with all elements really wouldn’t cut it (who has enough memory for 250 entries?), and getting any ad-hoc implementation to work right was guaranteed to be massive a pain in the neck. I did what came to my mind: it wasn’t a matter of pride, it was a matter of efficiency.