Advent of Code 2022 was a productive year for cj81499, with 24 days having at least Part 1 solved and the majority of those earning both stars. Notable gaps are Day 19 (Not Enough Minerals — unsolved) and the Part 2s of Days 16, 17, 22, and 25. Every solved day includes a corresponding test suite. The puzzles range from classic graph-search and simulation problems to number-theory tricks, expression trees, and blizzard-dodging pathfinding.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.
Puzzle inputs are personal and are not included in the repository. To run
these solutions you will need to supply your own input, for example via
aocd. See
Solution Structure for how the project is organised.
Progress
| Day | Title | Part 1 | Part 2 | Tests |
|---|---|---|---|---|
| 01 | Calorie Counting | ⭐ | ⭐ | ✅ |
| 02 | Rock Paper Scissors | ⭐ | ⭐ | ✅ |
| 03 | Rucksack Reorganization | ⭐ | ⭐ | ✅ |
| 04 | Camp Cleanup | ⭐ | ⭐ | ✅ |
| 05 | Supply Stacks | ⭐ | ⭐ | ✅ |
| 06 | Tuning Trouble | ⭐ | ⭐ | ✅ |
| 07 | No Space Left On Device | ⭐ | ⭐ | ✅ |
| 08 | Treetop Tree House | ⭐ | ⭐ | ✅ |
| 09 | Rope Bridge | ⭐ | ⭐ | ✅ |
| 10 | Cathode-Ray Tube | ⭐ | ⭐ | ✅ |
| 11 | Monkey in the Middle | ⭐ | ⭐ | ✅ |
| 12 | Hill Climbing Algorithm | ⭐ | ⭐ | ✅ |
| 13 | Distress Signal | ⭐ | ⭐ | ✅ |
| 14 | Regolith Reservoir | ⭐ | ⭐ | ✅ |
| 15 | Beacon Exclusion Zone | ⭐ | ⭐ | ✅ |
| 16 | Proboscidea Volcanium | ⭐ | ✗ | ✗ |
| 17 | Pyroclastic Flow | ⭐ | ✗ | ✅ |
| 18 | Boiling Boulders | ⭐ | ⭐ | ✅ |
| 19 | Not Enough Minerals | ✗ | ✗ | ✗ |
| 20 | Grove Positioning System | ⭐ | ⭐ | ✅ |
| 21 | Monkey Math | ⭐ | ⭐ | ✅ |
| 22 | Monkey Map | ⭐ | ✗ | ✅ |
| 23 | Unstable Diffusion | ⭐ | ⭐ | ✅ |
| 24 | Blizzard Basin | ⭐ | ⭐ | ✅ |
| 25 | Full of Hot Air | ⭐ | ✗ | ✅ |
Notable Solutions
Day 12 — Hill Climbing Algorithm
Part 1 finds the shortest path from the marked startS to the end E
across a height-map grid where each step may only climb at most one elevation
unit. A BFS from S records the cost to reach every cell; the answer is the
BFS distance recorded for E.
Part 2 asks for the shortest path from any ground-level cell (a or S)
to E. Rather than running a separate BFS from every possible starting point,
the solution simply reverses the search direction: it starts the BFS at E
and relaxes the movement constraint accordingly (now a step can only descend
at most one unit). The first ground-level cell reached by this reverse BFS gives
the global optimum in a single pass.
Day 21 — Monkey Math
Part 1 evaluates a tree of monkey expressions where each monkey either holds a literal integer or applies an arithmetic operator to the values of two other monkeys. Lazy resolution (eachUnresolvedMonkey caches its resolved form on
first access) means the full expression tree is evaluated in one recursive pass.
Part 2 changes the root monkey’s job to an equality check and asks what
value the humn monkey must have to satisfy it. The solution avoids symbolic
algebra by walking the expression tree twice: first it determines which subtree
contains the humn node, then it propagates a target value back down that
subtree, inverting each arithmetic operation along the way (add ↔ subtract,
multiply ↔ divide, with correct handling of non-commutative subtraction). No
external solver is needed — the tree structure guarantees a unique path from
root to humn.
Day 24 — Blizzard Basin
The valley is filled with blizzards that move and wrap around each minute, making the navigable cells time-dependent. The solution simulates the blizzard grid incrementally usingfunctools.cache: grid_after(t) is computed from
grid_after(t-1), so each unique minute is only simulated once even across
multiple traversals.
Pathfinding uses a min-heap (Dijkstra-style) where each state is (time, pos).
At each step the candidate can wait in place or move in any of the four cardinal
directions, provided the destination cell is empty at the next time step.
Part 2 requires three legs — start → goal, goal → start (the elf forgot
their snacks), then start → goal again — by re-running the same explore
function with the arrival time of one leg as the departure time of the next. The
cached blizzard simulation is shared across all three legs, so previously
computed grid states are reused for free.