advent-of-code/2021-python
Anders Ytterström c0d352cdf1 Solve 2021:12 "Passage Pathing"
I struggled a lot with the direction, but realised way too much later
that the mappings are bidirectional.

Part 2 was exceptionally hard, but I realised early that the order did
not matter and that a simple boolean lock was all that was needed. The
challenge was to know when to watch for duplicates.

The seen was initially a set, but since new sets must be sent instead of
references, a list is used instead to be able to use the seen + [] hack.
2021-12-12 14:39:11 +01:00
..
solutions Solve 2021:12 "Passage Pathing" 2021-12-12 14:39:11 +01:00
tests Solve 2021:12 "Passage Pathing" 2021-12-12 14:39:11 +01:00
.gitignore 🔧 Setup Advent of Code 2021 2021-10-22 17:17:55 +02:00
.python-version 🔧 Setup Advent of Code 2021 2021-10-22 17:17:55 +02:00
aoc.py 🔧 Setup Advent of Code 2021 2021-10-22 17:17:55 +02:00
README.md 🔧 Setup Advent of Code 2021 2021-10-22 17:17:55 +02:00

Advent of Code 2021

Solutions for #aoc2020 in Python 3 (3.8+).

Help scripts

Solve all puzzles:

python aoc.py

To bootstrap a new puzzle (creates inputs/<day_no>.txt, solutions/day_<day_no>.py och tests/test_day_<day_no>.py):

python aoc.py <dag_no> "<puzzle_name>"

Manually copy the puzzle input from https://adventofcode.com and paste it in inputs/<day_no>.txt to start coding.

Solve separate puzzle (replace XX with the puzzle number):

python -m solutions.day_XX

Run tests (replace XX with the puzzle number):

python -m unittest --locals -v
# or, if `pytest` is preferred:
pytest