2 min read

Advent of Code 2020 Day 15

When I first saw the puzzle, I figured using a map (of some sort) would be necessary to complete the puzzle, it was, and I just did that work later for part two rather than for part one.
Advent of Code 2020 Day 15

I really enjoyed today's puzzle probably because it had no real further optimization than what I had done (though I could probably arguably find SOME optimization to do) and it didn't require me to read files. I'm not against reading files, but I also feel like every single puzzle this time around has required a file, and I've figured out how to read files and don't really feel like doing it anymore. Today's puzzle for part one included a really cool way to take an input of numbers (separated by commas) and generate a sequence of values that relies upon the historical location of values in order to generate the next values in the sequence.

I initially did this work (in part one) by using a stream to find the previous index for the value that was just inserted, but part two expanded the values to use to 30,000,000 so that wasn't an option for part two. When I first saw the puzzle, I figured using a map (of some sort) would be necessary to complete the puzzle, it was, and I just did that work later for part two rather than for part one. This means the map wasn't necessary, but did end up speeding up runtime of the different parts. I have SINCE set my tests for day 15 to be ignored, this is to make the builds on GitHub faster and because I did put a test together for every single one of the 7 examples in the problem statement.

Speaking of builds on GitHub, yesterday, I tried learning GitHub Actions as part of my desired flow, so now, I will make pull requests for each day (and for any build changes) because I want to have fun with trying new things out when I get bored, maybe you'll see some sort of embed from the GitHub about my build, because why not? Below is a "live" embed of my default github branch build.

build-and-test

If you want to join my Advent of Code leaderboard, feel free to join with the code: 699615-aae0e8af.

Enjoying these posts? Subscribe for more