Advent of Code Solutions 🎄
May 6, 2026 · View on GitHub

My solutions to puzzles at adventofcode.com. Check out my collected tricks ✨ for solving AoC.
See also:
- erikw/hackerrank-solutions
- erikw/kattis-solutions
- erikw/leetcode-solutions
- erikw/project-euler-solutions
2024 Results
| Day | Part 1 | Part 2 |
|---|---|---|
| Day 1 | ⭐ | ⭐ |
| Day 2 | ⭐ | ⭐ |
| Day 3 | ⭐ | ⭐ |
| Day 4 | ⭐ | ⭐ |
| Day 5 | ⭐ | ⭐ |
| Day 6 | ⭐ | ⭐ |
| Day 7 | ⭐ | ⭐ |
| Day 8 | ⭐ | ⭐ |
| Day 9 | ⭐ | ⭐ |
| Day 10 | ⭐ | ⭐ |
| Day 11 | ⭐ | ⭐ |
| Day 12 | ⭐ | ⭐ |
| Day 13 | ⭐ | ⭐ |
| Day 14 | ⭐ | ⭐ |
| Day 15 | ⭐ | ⭐ |
| Day 16 | ⭐ | ⭐ |
| Day 17 | ⭐ | ⭐ |
| Day 18 | ⭐ | ⭐ |
| Day 19 | ⭐ | ⭐ |
| Day 20 | ⭐ | ⭐ |
| Day 21 | ⭐ | ⭐ |
| Day 22 | ⭐ | ⭐ |
| Day 23 | ⭐ | ⭐ |
| Day 24 | ⭐ | ⭐ |
| Day 25 | ⭐ | ⭐ |
All Results
Development Setup
Per Environment
macOS
brew bundle install
Debian/Ubuntu
sed 's/#.*$//' < apt-packages.txt | xargs sudo apt-get -y install
Ruby
bundle install
JavaScript
npm install
Python
pip install -r requirements.txt
Session Cookie
Fetch your AoC Session Cookie and set it up as an environment variable by either:
- putting it a
.envfile in the repo's root dir asAOC_SESSION=... - export in your shell ('s startup file) as
export AOC_SESSION=.... - Or some other way according to Session Cookie Expired?
Solve a Puzzle
and now solve today's puzzle or a specific one:
bin/solve_day.sh # Solve today's puzzle with default language (ruby)
bin/solve_day.sh 19/5 # 2019 day 5
bin/solve_day.sh -l py # Solve with language, here Python
To fetch input for an already solved problem:
bin/fetch_input.sh yy/mm
Tip
The default language can be set with an envvar, e.g., with dotenv in a .env fil,e which is also read by bin/solve_day.sh:
echo AOC_LANG=py >> .env
Session Cookie Expired?
Update AOC_SESSION in:
- The
.envfile for local development. - Codespaces secrets for GitHub Codespaces development.
- Action Secret for .github/workflows/readme-stars.yml.
- Vercel Envvar for erikw/adventofcode-badge.
- Then redeploy to restart the service.
- Or with CLI in the adventofcode-badge repo clone:
vercel env update -y AOC_SESSION && vercel deploy --prod