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 2017 is a complete year — all 25 days solved, both parts. The year has a playful computer-science theme: from circular buffers and hash functions to a Turing machine finale. Standout puzzles include the reusable Knot Hash algorithm (Days 10 and 14), the Spinlock circular buffer (Day 17), the Duet dual-program VM (Day 18), and the recursive tower balancing puzzle (Day 7). All solutions carry tests; Day 23 has a question-mark on its test status due to input-dependent behaviour.

Progress

DayTitlePart 1Part 2Tests
01Inverse Captcha
02Corruption Checksum
03Spiral Memory
04High-Entropy Passphrases
05A Maze of Twisty Trampolines, All Alike
06Memory Reallocation
07Recursive Circus
08I Heard You Like Registers
09Stream Processing
10Knot Hash
11Hex Ed
12Digital Plumber
13Packet Scanners
14Disk Defragmentation
15Dueling Generators
16Permutation Promenade
17Spinlock
18Duet
19A Series of Tubes
20Particle Swarm
21Fractal Art
22Sporifica Virus
23Coprocessor Conflagration
24Electromagnetic Moat
25The Halting Problem

Notable Solutions

Day 10 — Knot Hash

The Knot Hash is a custom hash algorithm used as a primitive in both Day 10 and Day 14. Part 1 is a single round of in-place circular-list reversal. Part 2 implements the full hash: the input string is converted to ASCII codes, a fixed suffix [17, 31, 73, 47, 23] is appended, and 64 rounds of reversal are run. The 256-byte sparse hash is condensed to a 16-byte dense hash by XOR-ing each 16-element chunk, then hex-encoded.
def knot_hash(txt: str) -> str:
    ascii_codes = list(map(ord, txt))
    lengths = [*ascii_codes, *SUFFIX]
    nums = [*range(DEFAULT_LIST_SIZE)]
    pos = skip_size = 0
    for _ in range(64):
        pos, skip_size = do_round(nums, lengths, pos=pos, skip_size=skip_size)
    sparse_hash = tuple(nums)
    return dense_hash(sparse_hash)

Day 7 — Recursive Circus

Part 1 finds the root of a weighted tree by identifying the one program that is never listed as a child. Part 2 detects the single unbalanced node — the one whose subtree weight differs from all its siblings — and computes what its weight should be. The solution walks the tree recursively, propagating subtree weights upward.

Day 18 — Duet

Part 1 interprets a register-based assembly language where the snd instruction plays a “sound” and rcv recovers it. Part 2 reinterprets snd/rcv as message-passing channels between two programs running concurrently. The two Program instances share queues and alternate execution until both are blocked, then the number of values sent by Program 1 is 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