All my solutions to the Advent of Code challenges, written in Go. Possibly the only thing I will ever get into the Christmas spirit for 🎄
I've separated each year into its own Go module. Each day is separated into two files, one for each part of the challenge. To run a solution, simply cd
into the directory and run go run . -solution 01p1
(where 01p1
is the day and part you want to run).
The -benchmark
flag can be used to time the execution of the solution. Using the -benchmark
flag on its own will run all solutions for the year 10 times over, getting the average execution time.
Note
Benchmarks are run via this GitHub Action and are not indicative of the performance of the code on your machine.
The action uses the ubuntu-latest
image and runs each solution 10 times to get an average. This is by no means a perfect benchmark, so take the results below with a grain of salt.
TODO:
- In the process of improving the performance of Day 5 part 2, I've gone and broken it to the point where it no longer gives the correct answer. So while it is an improvement of the original 1.5 hours, it still needs some work.
- Day 16 part 2 uses a brute force approach to find the answer. I'm certain with heavy caching and dynamic programming, it could be improved significantly.