Advent of Code - Day 2

undraw svg category

Advent of Code day 2 was a fun one. The explanation for part two took me a whie to wrap my head around,but once I did, the rest was pretty straightforward.

Though I did an ok job, at first. Refactored 3 or 4 times to come up with something that I’m mostly happy with.

Got my gold stars, then checked out reddit for other solutions.

Wow. After looking at a few great answers - I overengineered the shit out of this. I wasn’t going for speed, so I could afford to write some seriously verbose code.

Since it’s so large, it’s probably hard to read. I’ve included a link to the notebook that I used to work through this problem if that’s easier to read.

Either way, here’s the code in it’s entirety.

My Solution

Tags:

Previous Post undraw svg category

Conditional Probability and the Monty Hall Game

Next Post undraw svg category

Plaid Inspired Inputs with React Hooks and Styled Components