Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/cj81499/advent-of-code/llms.txt

Use this file to discover all available pages before exploring further.

Advent of Code 2020 is a complete year — all 25 days solved, both parts, with tests passing for every puzzle. The year’s theme follows a tropical vacation disrupted by global chaos, featuring puzzles centred on passport validation, bag rules, cellular automata, and even a sea-monster hunt inside a jigsaw of image tiles. Day 1 earned a top-100 score on the global leaderboard (38 points for Part 1).

Progress

DayTitlePart 1Part 2Tests
01Report Repair
02Password Philosophy
03Toboggan Trajectory
04Passport Processing
05Binary Boarding
06Custom Customs
07Handy Haversacks
08Handheld Halting
09Encoding Error
10Adapter Array
11Seating System
12Rain Risk
13Shuttle Search
14Docking Data
15Rambunctious Recitation
16Ticket Translation
17Conway Cubes
18Operation Order
19Monster Messages
20Jurassic Jigsaw
21Allergen Assessment
22Crab Combat
23Crab Cups
24Lobby Layout
25Combo Breaker

Notable Solutions

Day 4 — Passport Processing

Part 1 checks that all required fields (byr, iyr, eyr, hgt, hcl, ecl, pid) are present. Part 2 adds strict validation: birth year must be a 4-digit number in [1920, 2002], height must be in the correct range for cm or in units, hair colour must match #rrggbb, and so on. Each rule is handled by an explicit if branch, making the validation logic easy to audit.

Day 17 — Conway Cubes

The solution is dimension-agnostic. Active cells are stored in a set[Point] where Point is a tuple of arbitrary length. A cached neighbors function generates all 3^n - 1 neighbours for an n-dimensional point using itertools.product. Part 1 runs 3-D Game-of-Life for 6 cycles; Part 2 simply passes dimensions=4 to the same solve function.
@functools.cache
def neighbors(p: Point) -> tuple[Point, ...]:
    return tuple(
        tuple(x + d for x, d in zip(p, deltas, strict=True))
        for deltas in itertools.product(*itertools.repeat((-1, 0, 1), len(p)))
        if any(x != 0 for x in deltas)
    )

part_1 = solve
part_2 = functools.partial(solve, dimensions=4)

Day 20 — Jurassic Jigsaw

Each Tile wraps a NumPy array so that rotations and reflections are handled with np.rot90 and np.flip. Tiles are matched edge-to-edge by comparing border strings. Once all tiles are assembled into a grid, the combined image is scanned for the sea-monster pattern using a set of known relative offsets, and the total # count minus found sea-monster # cells gives the answer.
Puzzle inputs are personal and are not stored in this repository. Solutions fetch input at runtime using aocd (aocd.data).

Build docs developers (and LLMs) love