Advent of Code 2021 sent participants on an underwater adventure to retrieve Santa’s sleigh keys from the ocean floor. Of the 25 days published, 21 days are fully solved (both parts), with Day 19 (Beacon Scanner) unsolved and Days 23 and 25 missing their second part. All solved days include passing tests and type-checked implementations. The year features a satisfying mix of simulation puzzles, recursive algorithms, and binary packet parsing.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.
Progress
| Day | Title | Part 1 | Part 2 | Tests |
|---|---|---|---|---|
| 01 | Sonar Sweep | ⭐ | ⭐ | ✅ |
| 02 | Dive! | ⭐ | ⭐ | ✅ |
| 03 | Binary Diagnostic | ⭐ | ⭐ | ✅ |
| 04 | Giant Squid | ⭐ | ⭐ | ✅ |
| 05 | Hydrothermal Venture | ⭐ | ⭐ | ✅ |
| 06 | Lanternfish | ⭐ | ⭐ | ✅ |
| 07 | The Treachery of Whales | ⭐ | ⭐ | ✅ |
| 08 | Seven Segment Search | ⭐ | ⭐ | ✅ |
| 09 | Smoke Basin | ⭐ | ⭐ | ✅ |
| 10 | Syntax Scoring | ⭐ | ⭐ | ✅ |
| 11 | Dumbo Octopus | ⭐ | ⭐ | ✅ |
| 12 | Passage Pathing | ⭐ | ⭐ | ✅ |
| 13 | Transparent Origami | ⭐ | ⭐ | ✅ |
| 14 | Extended Polymerization | ⭐ | ⭐ | ✅ |
| 15 | Chiton | ⭐ | ⭐ | ✅ |
| 16 | Packet Decoder | ⭐ | ⭐ | ✅ |
| 17 | Trick Shot | ⭐ | ⭐ | ✅ |
| 18 | Snailfish | ⭐ | ⭐ | ✅ |
| 19 | Beacon Scanner | ❌ | ❌ | ❌ |
| 20 | Trench Map | ⭐ | ⭐ | ✅ |
| 21 | Dirac Dice | ⭐ | ⭐ | ✅ |
| 22 | Reactor Reboot | ⭐ | ⭐ | ✅ |
| 23 | Amphipod | ⭐ | ❌ | ❌ |
| 24 | Arithmetic Logic Unit | ❌ | ❌ | ❌ |
| 25 | Sea Cucumber | ⭐ | ❌ | ✅ |
Notable Solutions
Day 11 — Dumbo Octopus
The grid is stored as adict[Point, int] mapping (x, y) coordinates to energy levels. Each step increments every cell, then propagates flash energy to all eight neighbours of any cell whose value exceeds 9. Part 1 counts total flashes over 100 steps; Part 2 uses itertools.count to find the first step where every octopus flashes simultaneously.
Day 16 — Packet Decoder
The solution models the BITS transmission as a class hierarchy: an abstractPacket base with LiteralValuePacket and OperatorPacket subclasses. Each packet type implements an evaluate() method, so the full expression tree can be evaluated with a single recursive call. Part 1 sums all version numbers by walking the tree; Part 2 evaluates the root packet.
Day 21 — Dirac Dice
Part 1 simulates the deterministic 100-sided die directly. Part 2 uses top-down memoization via@functools.cache on a frozen State dataclass. All 27 possible three-roll combinations (3 dice × 3 faces) are explored at each turn, and win counts are accumulated recursively without re-computing duplicate states.
Puzzle inputs are personal and are not stored in this repository. Solutions fetch input at runtime using aocd (
aocd.data).