Yet again I got stuck in the common AOC trap: The example input worked, but not the actual input. 2 things got me stuck. > The size of a basin is the number of locations within the basin, including the low point. The example above has four basins. 1. I missed the obvious part to only check the low points. 2. Based on the example, I asumed that the adjacent locations would increase by one to count. This is wrong: What matters is that their height is a larger value. Way too long time for a simple problem. Never read puzzles sloppy. |
||
|---|---|---|
| .. | ||
| solutions | ||
| tests | ||
| .gitignore | ||
| .python-version | ||
| aoc.py | ||
| README.md | ||
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