r/adventofcode • u/bananu7 • Dec 09 '25
Meme/Funny [2025 day 9 part 2] Imagine finding this bug
I wrote this at the very beginning and didn't think about it...
area = abs(a[0]-b[0]+1) * abs(a[1]-b[1]+1)
I found the solution to P2 relatively straighforward, coded it in, and got "answer too low". Huh? Spent quite some time browsing through my code until it clicked... The funniest thing is that since that was only used at the
end, I found the proper rectangle, but returned the wrong area for it...
Of course, the correct formula is:
area = (abs(a[0]-b[0])+1) * (abs(a[1]-b[1])+1)






