Day 9 also required some optimizations, if you aren’t careful, you end up with really inefficient algorithms with time/memory complexity beyond what a typical machine has 🤣

⤋ Read More

@movq@www.uninformativ.de I shrank Day 9 Part 2 from “cover the whole map” to “only track the interesting lines.” By compressing coordinates to just the unique x/y breakpoints, the grid got tiny. I still flood-fill and do the corner-pair checks, but now on that compact grid with weighted prefix sums for instant rectangle checks. Result: far less RAM, way less CPU, same correct answer.

⤋ Read More

Participate

Login to join in on this yarn.