This is a thread to discuss Day 9
It is VERY important NOT to write any public spoilers
ALWAYS keep spoiler stuff hidden inside one of these
This text will be hidden
which you can obtain by clicking on the gear icon
FYI one of the features of Advent of Code is that we all get given different inputs so our answers will be different.
The examples are all the same but each of us gets different inputs for us to solve
Been busy today doing real world stuff but easiest puzzle so far for me
It took 5 mins to alter code for Part 1 into Part 2
 Link fixed
The link doesn’t work for meIt does now..
But indeed, it’s a simple puzzle, especially if you use recursion.
simply reverse each input line:
Part 1 was honestly pretty easy, and I was actually surprised at how fast it ran due to a bunch of recursion (although I figured out how to find the pattern using hyperblocks).
I was very glad to know that I didn't need to remove the last element from the list. Of course I did make an optimization, instead of going until all the differences are 0, it just goes until they're equal. I decided to do this because if they're equal, the difference will be 0. It just removes an extra unnecessary step.
I just modified my code from part 1 to work for part 2. Glad it was such a simple edit.
Snap! Build Your Own Blocks