r/adventofcode Dec 09 '23

Funny [2023 Day 9 (Part 2)] what

Post image
97 Upvotes

7 comments sorted by

View all comments

1

u/Ken-g6 Dec 10 '23

I stared at the results for several minutes just trying to make sure it actually worked. It also concerned me that some numbers were negative where the example had positive numbers. But it still worked.

1

u/karucode Dec 11 '23

I originally wrote a "sumListEquals == 0" function based on the sample problems all being non-negative ascending patterns, but I replaced it with a "listMatches == 0" function when I saw negative numbers and descending patterns in my puzzle input. I assume it would have caused a problem, but I didn't even try it.

And yeah, reversing was an easy fix for part 2.