An open API service indexing awesome lists of open source software.

https://github.com/erikw/advent-of-code-solutions

My solutions to puzzles at https://adventofcode.com/
https://github.com/erikw/advent-of-code-solutions

advent-of-code adventofcode aoc competitive-programming programming-challenges solutions

Last synced: 8 months ago
JSON representation

My solutions to puzzles at https://adventofcode.com/

Awesome Lists containing this project

README

          

# Advent of Code Solutions 🎄

[![Total stars from all years](https://img.shields.io/badge/dynamic/json?logo=data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAfQ29tcHJlc3NlZCBieSBqcGVnLXJlY29tcHJlc3P/2wCEAAQEBAQEBAQEBAQGBgUGBggHBwcHCAwJCQkJCQwTDA4MDA4MExEUEA8QFBEeFxUVFx4iHRsdIiolJSo0MjRERFwBBAQEBAQEBAQEBAYGBQYGCAcHBwcIDAkJCQkJDBMMDgwMDgwTERQQDxAUER4XFRUXHiIdGx0iKiUlKjQyNEREXP/CABEIAEAAQAMBIgACEQEDEQH/xAAcAAEAAgIDAQAAAAAAAAAAAAAABggFBwMECQH/2gAIAQEAAAAAo+ZXkwwNz5LQwnkD3pk68TyBrFb2kfbiejq3H30t5vM/jFs4d0tlVAMhcWlS5tScQAf/xAAYAQADAQEAAAAAAAAAAAAAAAABBQYCBP/aAAgBAhAAAABtxDuVyOa9rAi/ysLH/8QAGAEAAwEBAAAAAAAAAAAAAAAAAQIEAAP/2gAIAQMQAAAAnbL0oM3Osxl8n//EADYQAAEEAQEEBwYEBwAAAAAAAAIBAwQFBgcACBEhEBITIDEyQRQVIlNhchYXMFJic4KRkqPB/9oACAEBAAE/AOmkpLTI7SJS0sQpM+USgyyKoimqJx9dsgx+4xa2k0d9CKJYx0BXWTVFUe0BDHmPFOaL393xvtNXcR+jr5f4sntvLN9TWDIS/fGgH/oEe7K0xz6JQV2UHi85ynmxhlNSWG+2RGj5oTiBxIEVPUujduDr6wYx9AnF/aKe29E31NWZxfMrIRdFdpjntpSzsji4xNSpiRjkuSng7ECaBOKq31+Cuf09OCbyuc4gzDrbEGL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MMhLLDY3U7fAJXYam1D9EO5Jn//2Q==&labelColor=black&color=118a03&label=all&query=allStars&url=https://adventofcode-badge-erikw.vercel.app/api)](#)
[![GitHub language count](https://img.shields.io/github/languages/count/erikw/advent-of-code-solutions)](#)
[![GitHub top language](https://img.shields.io/github/languages/top/erikw/advent-of-code-solutions)](#)
[![Languages Used](https://img.shields.io/badge/solution%20languages-Ruby,%20JavaScript,%20Python-blue)](#)
[![SLOC](https://sloc.xyz/github/erikw/advent-of-code-solutions?lower=true)](#)
[![GitHub last commit (branch)](https://img.shields.io/github/last-commit/erikw/advent-of-code-solutions/main)](#)
[![Update README ⭐](https://github.com/erikw/advent-of-code-solutions/actions/workflows/readme-stars.yml/badge.svg)](https://github.com/erikw/advent-of-code-solutions/actions/workflows/readme-stars.yml)



Open in GitHub Codespaces



My solutions to puzzles at [adventofcode.com](https://adventofcode.com/). Also check out my collected [tricks](tricks.md).

```perl
`}-' `}-'
___ `}-' `}-' ____/`-, _____/`-,
"-_/}__ `}-'_/`-, /`-,( _,,.{-,_(__,,,.(
[(_.-'`--,__ ____/`-,.(,-`}-'_,>___\/`-, >|`---\
[(__\___\ _`-(--...(..-'_`./`-,/(--,,.( // / >
|_______/-' >`---\ / ( `{ >`---\
__|___|__) / \ / \ /`--/< / \ /|
/ \/ \
```

See also:
* [erikw/hackerrank-solutions](https://github.com/erikw/hackerrank-solutions/)
* [erikw/kattis-solutions](https://github.com/erikw/kattis-solutions/)
* [erikw/leetcode-solutions](https://github.com/erikw/leetcode-solutions/)
* [erikw/project-euler-solutions](https://github.com/erikw/project-euler-solutions)

## 2024 Results

| Day | Part 1 | Part 2 |
| :---: | :---: | :---: |

## All Results

Stars 2015


Stars 2016


Stars 2017


Stars 2018


Stars 2019


Stars 2020


Stars 2021


Stars 2022


Stars 2023


Stars 2024

## Development Setup
### Per Environment
#### macOS
```shell
brew bundle install
```

#### Ruby
```shell
bundle install
```

#### JavaScript
```shell
npm install
```

#### Python
```shell
pip install -r requirements.txt
```

### Session Cookie
Fetch your [AoC Session Cookie](https://github.com/wimglenn/advent-of-code-wim/issues/1) and store as an envvar or in `.env` as `$AOC_SESSION`.

### Solve a Puzzle

and now solve today's puzzle or a specific one:

```shell
bin/solve_day.sh # Solve today's puzzle with default lanuage (ruby)
bin/solve_day.sh 19/5 # 2019 day 5
bin/solve_day.sh -l py # Solve with language, here Python
```

> [!TIP]
> The default language could be set with an envvar, e.g. with dotenv in a `.env` file which is also read by `bin/solve_day.sh`:
> ```shell
> echo AOC_LANG=py >> .env
> ```

## Session Cookie Expired?
Update:
* `AOC_SESSION` in local `.env` for local development.
* `AOC_SESSION` in [Codespaces secrets](https://github.com/erikw/advent-of-code-solutions/settings/secrets/codespaces) for GitHub Codespaces development.
* `AOC_SESSION` in [Action Secret](https://github.com/erikw/advent-of-code-solutions/settings/secrets/actions) for [.github/workflows/readme-stars.yml](.github/workflows/readme-stars.yml).
* `SESSION` in [Vercel Envvar](https://vercel.com/erikw/adventofcode-badge/settings/environment-variables) for [erikw/adventofcode-badge](https://github.com/erikw/adventofcode-badge).
* Then [redeploy](https://vercel.com/erik-westrups-projects/adventofcode-badge/deployments) to restart the service.