Ecosyste.ms: Awesome

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

https://github.com/npanuhin/Advent-of-Code

My elegant solutions to the captivating Advent of Code 🎄
https://github.com/npanuhin/Advent-of-Code

advent-of-code advent-of-code-2020 advent-of-code-2021 advent-of-code-2023 adventofcode aoc

Last synced: 6 days ago
JSON representation

My elegant solutions to the captivating Advent of Code 🎄

Lists

README

        

🎄 Advent of Code 🎄


by @npanuhin



---

This is a repository of my [Advent of Code](https://adventofcode.com "Visit adventofcode.com") solutions.
Some puzzles are accompanied by concise descriptions 😉

I try to optimize each solution as much as possible, so although they are written in Python, many run in less than a second!

> Also check out [these cool **animated** annual AoC images](#gallery-of-amazing-annual-advent-of-code-images)!



2020
2021
2023


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
⭐⭐
⭐⭐
⭐⭐

💎 — A brief description is available

---

#### Some facts about this repository:

- My goal is to keep solutions as close to the original as possible, so **I generally do not edit past solutions**. Sometimes I correct the code style (without even remembering what the task was about), but in the future I will try not to do this

#### I also follow some rules for writing my solutions:

- The entire repository is [PEP8](https://pep8.org/) compliant, as [verified](../../actions/workflows/lint.yaml) by the `flake8` linter (with the [exception of some rules](tox.ini#L21-L48))

- **Input files may contain any number of empty lines**, especially at the end. In some cases, this also applies to whitespace characters.

Currently I like to handle this rule using the following general snippet to read files:

```py
with open('input.txt') as file:
lines = list(filter(None, map(str.strip, file)))
```

---

Gallery of amazing annual Advent of Code images

> If you computer scruggles to render smooth animations, [buy a new one](https://youtu.be/Q-yYmq35E3I?t=2)[^1] :)


2020
2021


2022
2023

Wanna know how I automatically created ***animated vector images*** with transparent gradient borders **within GitHub Markdown**?
Check out [this folder](.github/src/canvas)

[^1]: Joking of course! It's just that almost all annual AoC images contain a ton of HTML objects, each with its own animation. Rendering one image on a modern hardware is easy, but when there are many of them, it becomes a mess)
In all seriousness, I'm not sure if I want to hold on to these animations or drop some of them