← Home

It's a Metric, Too

Solving Jane Street's October 2026 puzzle by guessing well and letting a solver prove me wrong.

Jane Street's October 2026 puzzle is a partially filled 11×11 grid of numbers and asks you to carve it into "states." Every state has to be connected and symmetric, some states have a capitol, and every cells number is the cheapest cost of travelling from that cell to the nearest capitol.

I spent about 10 hours over 3 days. The first day went to trying to brute force it, which didn't work. The other two went to making educated guesses about pieces of the board and building tools to tell me quickly whether each guess was wrong, eventually getting to the answer. Claude code did the heavy lifting on the programming side.

The puzzle grid, from Jane Street

The rules

Written out, with S(u) the size of the state containing cell u:

cost(u, v) = min(S(u), S(v))                    for neighbouring cells u, v
d(u)       = cheapest path cost from u to any capitol
answer     = Σ_rows ( Σ_cols S(r, c) )²

Theory

The main thing that guided the search were maximum and minimum bounds on the sizes of states that cells could be in. They all use the fact that d is a shortest-path distance.

Capitols

  S = 1 + (sum of orbit sizes, each 2 or 4)  →  S is odd

Neighbouring cells

For neighbours u and v, d can't change by more than the one step between them:

|d(u) − d(v)| ≤ min(S(u), S(v))

So both cells have size at least the gap. This one rule is responsible for most of the early deductions:

A 1 needs a 1×1 next to it. d(u) = 1 means the last step cost 1, which needs min(S(u), S(v)) = 1. So v is a 1×1 state, and a 1×1 state is its own capitol. Its neighbours, in turn, must all have d ≤ 1, so a 1×1 capitol can never touch a 2 or higher.

That pinned r6c11 as a 1×1 capitol. r5c11 = 1 has three candidate neighbours. r5c10 touches a 4 and r4c11 touches a 14, and neither 4 nor 14 can sit next to a 1×1 capitol.

Two and three steps apart

The same idea over longer paths. If A − W − B is a two-step path:

|d(A) − d(B)| ≤ cost(A,W) + cost(W,B) ≤ 2·S(W)

  ⇒  S(W) ≥ ⌈Δ / 2⌉            (the middle cell)
     S(A) + S(B) ≥ Δ           (the two ends)

where Δ = |d(A) − d(B)|. Over three steps A − W1 − W2 − B, the two middle cells share the load:

S(W1) + S(W2) ≥ ⌈2Δ / 3⌉

These produced the numbers that told me where the giant states had to be:

  S(r11c7) + S(r11c8) ≥ ⌈2·77 / 3⌉ = 52

so at least one of them is in a state of size ≥ 26. In the final board both are 37.

Distance to the nearest capitol

A clue d needs a capitol within ⌈d/2⌉ steps. Walking out from a capitol, only the first step can cost 1: a step costs 1 only when it touches a 1×1 state, and any 1×1 state is itself a capitol. Every later step costs at least 2. So reaching a cell k steps away costs at least:

d ≥ 1 + 2(k − 1) = 2k − 1    ⇒    k ≤ (d + 1) / 2

Applied to every clue, 9 of them couldn't reach the capitols I already knew about. That meant at least 3–4 more capitols, each confined to a small zone.

Inside a state, a small clue needs a way out. If every neighbour of u is in its own state, then every step out costs S(u), so d(u) ≥ S(u). Turned around:

0 < d(u) < S(u)   ⇒   u must touch a smaller state

An empty cell walled in on all sides has the same problem in reverse: it has to become a state of its own, and a 1×1 state is a capitol.

Every non-capitol has a cheaper neighbour it got its distance from. It's what the final checker tests:

d(u) = min over neighbours v of ( d(v) + min(S(u), S(v)) )

Area

Every cell belongs to exactly one state, so the distinct state sizes add up to the board:

Σ over states S = 121

Two cells that each need a huge state can't be in two separate huge states if the free area doesn't have room for both. This turned out to be the key fact (below).

From inequalities to a solver

The solver keeps a range [minS, maxS] for every cell's state size and tightens it with two shortest-path runs:

Shaving is how the 51 at r4c4 was pushed from "≥ 22" to "in a state of at least 37 cells" once a few states were placed around it.

Brute force doesn't work

My first solver was a depth-first search in JavaScript:

Shapes grow one orbit at a time. To make that easy, double the coordinates, so cell centres sit on even numbers and grid lines on odd ones. Every mirror axis and rotation centre then becomes a simple map:

vertical mirror      (r, c) → (r, p − c)
horizontal mirror    (r, c) → (p − r, c)
main diagonal        (r, c) → (c + k, r − k)
anti-diagonal        (r, c) → (p − c, p − r)
180° turn            (r, c) → (p − r, q − c)

On an 11×11 board that's 525 symmetries in total. Each map, applied twice, has to give back the starting cell; that was a useful unit test.

It solved the 5×5 example instantly (8045, matching the official answer). On the real board the first cell alone had over 10⁷ branches, and it ran out of memory in under five minutes.

Next I wrote a CP-SAT model in OR-Tools:

It was correct: on randomly generated puzzles with planted answers it never missed the answer and never returned a wrong board. On the real board it ran 10 minutes and never found a single candidate.

The problem was the same both times. A clue like 77 forces a giant symmetric state, and neither method can build a 37-cell symmetric shape by chance. Something had to place the big pieces first.

Educated Guessing

So I switched methods: I guess a piece of the board manually from looking at it, then the computer tries as hard as it can to prove the guess wrong.

The tools I ended up with:

The loop: fix a few states I believe in, enumerate what has to go next to them, kill whatever breaks a clue, repeat. When everything dies, one of my guesses was wrong. Back out the least certain one.

Things I got wrong

The left side. My first anchors:

The region solver found 9 ways to fill columns 1–5 around those pieces. Every one died once I tried to extend its half-finished states into the right half of the board. I didn't know yet which piece was wrong.

Top right. The 1s at r3c6 and r4c7 each need a 1×1 neighbour. Both touch r3c7 and r4c6; the alternatives each failed. r4c6 doesn't work as the 1×1: then r4c5 has d ≤ 1 right next to the 51, forcing a gap of 50 across one edge, so both cells would need states of size ≥ 50. So r3c7 is the 1×1 capitol.

There was also an 11-clue at r2c8, sitting next to cells with d ≤ 1, so its state is at least 10 cells. Of 579 symmetric 10-cell shapes there, one survived every check: a ring around r3c7. I also drew the rest of the right side by eye:

All of it filled in consistently.

The giant state. By shaving, r4c4 sits in a state of at least 37 cells. I swept 224 combinations of my 11-cell state's shape and the 10-state. In none of them was there room left for that state, and the search was exhaustive. So the 11-cell state was the broken piece. Its capitol was right; its shape wasn't.

Breakthroughs

Two key observations.

Area. r4c4 needs a state of at least 37 cells. Next to the 45, r8c9 needs one of at least 36. After the pieces already placed, only about 64–71 cells are free:

37 + 36 = 73 > 71

Two separate giants don't fit, so they're the same state, wrapping from the top-left pocket to the bottom-right.

Its capitol. The 10 at r6c6 looked like two steps of cost 5 to the right, through r6c7 to the capitol at r6c8:

d(r6c6) = min(37, 5) + min(5, 5) = 5 + 5 = 10

So r6c7 sits in a state of size ≥ 5. I guessed the giant was exactly 37 cells (odd, as a capitol state must be) with its capitol at r7c6.

With that pinned, the search shrank a lot:

An independent checker that shares no code with the solver confirmed it: every state connected and symmetric, every capitol valid, every clue equal to the true shortest cost.

The solved board: each color is one state, dots mark the capitols

sizes (* = capitol)
 4  4  4  4  7 10  5  5  5  5  5
 7  7 *7  7  7 10 10 10  7 *7  7
 7 37 37 37 37 10 *1 10  7 12  7
11 37 37 37 37 10 10 10  7 12  7
11 11 37 37 37 37  5 10  2 12 12
11 37 37 37 37 37  5 *5  2 12 *1
11*11 11  2 37*37 37  5  5 12 12
10 10 11  2  4 37 37 37 37 37 12
10 11 11  4  4 37 37 37 37 12 12
10 10 11 10  4  3 37 37 37 37 12
10 10 10 10  3 *3 37 37 37 37 12

You can check the big clues by hand against the cheapest paths:

r4c4  = 51:  37 (into r3c4) + 7 + 7                 → capitol r2c3
r11c9 = 77:  37 + 37 + min(37, 3) = 37 + 37 + 3     → capitol r11c6
r11c10 = 61: 12 + 12 + 12 + 12 + 12 + 1             → capitol r6c11
r9c9  = 45:  12 + 12 + 12 + 5 + 2 + 2               → capitol r6c8

The 77 is exactly the three-step bound from earlier: S(r11c7) + S(r11c8) = 74 ≥ 52.

Row sums: 58, 86, 202, 215, 211, 221, 180, 234, 212, 208, 206. The sum of their squares is 408951.

What held up

Most of my manual guesses were right:

The 11-state I'd been sure of runs down the left edge instead, and the 5-state at r6c8 is a Z shape, not the domino I first pictured.

Takeaways


More writeups