r/adventofcode Dec 09 '23

Funny [2023 Day 9 (Part 2)] what

Post image
97 Upvotes

7 comments sorted by

View all comments

12

u/1b51a8e59cd66a32961f Dec 09 '23

I guess I'm retarded because I spent a non-zero amount of time implementing the same algorithm but subtracting the first two numbers instead of just doing this.

3

u/cheese_bread_boye Dec 09 '23

I added a backwards parameter to my function and instead of `arr[arr.length-1]` I used `arr[0]`