This repo contains my solutions to Advent of Code problems, written in Python 3.
Each year's directory contains one dayXX.py file per day, with solutions to both parts of the problem. I aim to make my solutions readable and well-documented, so some years may be missing solutions that I haven't polished up yet (my initial solutions are sometimes much hackier, and need a lot of cleaning up before I'll post them here).
This scoreboard summarizes the problems I've solved so far. You can click on the ✅ checkmarks to access the code for specific problems.
| Symbol | Meaning |
|---|---|
| ✅ | Both stars solved, solution in repo |
| ✔️ | Both stars solved, solution not yet in repo |
| ⏳ | One star solved |
| ⚪ | Not yet solved |
| 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2025 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✔️ | ✅ | ✔️ | ✔️ | ✔️ | |||||||||||||
| 2024 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ |
| 2023 | ✅ | ✅ | ✅ | ✅ | ✔️ | ✅ | ✅ | ✅ | ✅ | ✔️ | ✔️ | ✅ | ✅ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ⏳ | ✔️ | ⏳ | ✔️ | ✔️ | ⏳ | ⏳ |
| 2022 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 2021 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 2020 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 2019 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| 2018 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ |
| 2017 | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ |
| 2016 | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ |
| 2015 | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ |
To run the solutions, you will first need to create a virtual environment and install a few libraries:
python3 -m venv venv
source venv/bin/activate
pip3 install -e .
This repository contains sample input data, but you will need to download the actual input data if you want to run the solutions. You have two options:
-
Manual download: If you are only testing an individual problem, you can log into Advent of Code and download the input data and save it to
YYYY/input/DD.in(e.g., if you're testing 2025 Day 3 you would save the input to2025/input/03.in) -
Automated download: There is a
download_inputs.pyscript that will download all the input files needed for the solutions in the repo. To be able to run it, you will first need to export your AoC session cookie like this:export AOC_SESSION=<token>
If you are not sure how to get your session cookie, see this page
Once you've activated the virtual environment, and have downloaded the necessary input data, you can run individual solutions from each year's directory like this:
python3 dayXX.py