My solutions for the 2021 Advent Of Code puzzles
This code is very much the first thing I thought of to solve each problem. Advent Of Code rarely rewards code written to solve a problem in the cleanest way: brute force is much more likely to give an answer quickly, at least for the early problems.
The folder src/
contains the original scripts I wrote (the first few days have no scripts because I just
used the Python repl. The folder input
has the puzzle input, and in some cases the sample input
given in the problem description as well.
Jupyter Notebooks (.ipynb files) in this folder contain the puzzle together with the solutions and perhaps some comments. For those who don't know Jupyter, it mixes text with code in a style similar to Knuth's Literate Programming. The output from each code block is shown directly under the relevant code and values carry over from one block to the next. The text is mostly taken straight from the relevant problem page on AdventOfCode.com, the code is my own (except where stated) and I've tried to highlight comments that I added so it's clear.
The output shown from the code blocks should match either the example answer or my actual answer (shown as Your Answer ... in the text) as appropriate.