a field manual of proven algebras — every claim witnessed, every inventory self-counting
MIT license · five production languages · six accepted harness records · zero fabricated benchmarks
"A solution without a witness is a rumor with indentation." — house rule, Tar0 registry
Contents
- What this repo is
- How to read a dossier
- The map
- The live vault
- The flagship lesson
- Witness discipline
- Failure-mode catalogue
- Receipts
- Study protocol
A study room, not an answer dump. Each problem lives in one folder; each language lives in one subfolder; each subfolder holds a dossier and a kernel. The same algebra travels across Racket, C, Java, Python, and JavaScript with zero drift: when a bound changes in one port it changes in all, because the ports are translations of one proof, not five guesses.
What you carry out of here is technique that outlives the problem: run-fold scanning, priced greedy with exchange arguments, regime analysis, online refutation, meet-in-the-middle over bucketed counts, and the habit of naming entry points from evidence instead of from titles.
- Structural fact. Why the algorithm is the only possible one; the invariant and the closure property that make it composable.
- Pipeline. The scan and its accumulators, drawn with the exact variable names you will meet in the source.
- Price market. When a budget exists, its prices tabulated cheapest-first with the exchange argument in one sentence.
- Witness traces. Full arithmetic tables; recompute any cell by hand and catch any lie.
- Source. The kernel: comment-free, single-responsibility, public names delegating to one private kernel.
- Failure notes. Bounds, overflow, sentinel, binding, allocation — each closed with a reason, not a hope.
Read in that order. The order is the pedagogy; jumping straight to the source is reading the verdict before the trial.
The tree below mirrors the repository at the last commit. Folders first, files after, indentation as the only ornament. It is an instrument reading, not prose; it is never edited by hand.
📦 Leetcode-Solution/
├── 📁 .github/
│ └── 📁 workflows/
│ └── ⚙️ auto-atlas.yml
├── 📁 Problem/
│ ├── 📁 2035. Partition Array Into Two Arrays to Minimize Sum Difference/
│ │ ├── 📁 c/
│ │ │ ├── 📖 README.md
│ │ │ └── ⚪ solution.c
│ │ ├── 📁 java/
│ │ │ ├── 📖 README.md
│ │ │ └── 🟠 solution.java
│ │ ├── 📁 javascript/
│ │ │ ├── 📖 README.md
│ │ │ └── 🟡 solution.js
│ │ ├── 📁 python/
│ │ │ ├── 📖 README.md
│ │ │ └── 🔵 solution.py
│ │ └── 📁 racket/
│ │ ├── 📖 README.md
│ │ └── 🟪 solution.rkt
│ ├── 📁 2299-strong-password-checker-II/
│ │ └── 📁 c/
│ │ ├── 📖 README.md
│ │ └── ⚪ solution.c
│ └── 📁 420-strong-password-checker /
│ ├── 📁 c/
│ │ ├── 📖 README.md
│ │ └── ⚪ solution.c
│ ├── 📁 Java/
│ │ ├── 📖 README.md
│ │ └── 🟠 solution.java
│ ├── 📁 JavaScript/
│ │ ├── 📖 README.md
│ │ └── 🟡 solution.js
│ ├── 📁 python3/
│ │ ├── 📖 README.md
│ │ └── 🔵 solution.py
│ └── 📁 racket/
│ ├── 📖 README.md
│ └── 🟪 solution.rkt
├── ⚖️ LICENSE
└── 📖 README.md
📊 25 files · 17 folders
One line per problem. The checkbox ticks the moment a dossier folder exists; the five-square meter fills, language by language, the moment a source file lands anywhere inside that folder. Add a folder or drop a file anywhere and the vault recounts itself in the next commit.
Meter legend: 🟪 Racket · ⚪ C · 🟠 Java · 🟡 JavaScript · Python · ⬜ not yet
- 420 · Strong Password Checker · 🟪⚪🟠🟡🔵 · 10 files · dossier
- 2035 · Partition Array Into Two Arrays To Minimize Sum Difference · 🟪⚪🟠🟡🔵 · 10 files · dossier
- 2299 · Strong Password Checker II · ⬜⚪⬜⬜⬜ · 2 files · dossier
📊 3 problems · 22 files inside dossiers
The repo-wide census, as GitHub's own language bar reports it:
🟪🟪🟪 ⚪⚪ 🟠🟠 🟡🟡 🔵
| Language | Share | What studying this port teaches |
|---|---|---|
| 🟪 Racket | 25.1 % | tail recursion as the only loop; values as unboxed multi-return; how a driver's naming convention overrides every convention you brought |
| ⚪ C | 20.8 % | NUL-terminator reasoning; header-free translation units; static inline folds and radix passes that lower to straight-line code |
| 🟠 Java | 19.5 % | primitive-only hot paths; static flat buffers reused across testcases; fused recurrence and bucketing in one pass |
| 🟡 JavaScript | 17.8 % | IEEE-754 exactness below 2^53; typed arrays with native numeric sort; tabulated popcount |
| 🔵 Python | 16.8 % | exact integers by language guarantee; keyword collision discipline; a vectorized fast path with an exact pure fallback |
LeetCode 420 is the teaching vehicle: three defects (length outside
0 6 20 n
├────────┼───────────────────┼───────────────────▶
insert replace-only delete + replace
In the overlong regime a deletion is worth exactly the replacement it cancels, priced by
Exchange argument, one sentence: if a solution buys a cancellation at a higher price while a cheaper one remains unbought, swapping the purchase to the cheaper run never increases total cost; therefore cheapest-first is optimal.
A formula table is a claim; a witness family is a test. Families here are small, hand-computable, and lethal to wrong variants.
| Witness | What it discriminates | Outcome |
|---|---|---|
| 21 identical chars | price-1 existence: without mod-0 buys the answer would be 8, not 7 | 7 |
| 25 identical chars | price-2 existence: skipping mod-1 buys yields 12, not 11 | 11 |
| 27 identical chars | price-3 closed form: concentration must hold for naive and closed forms to agree | 13 |
"aaa111" |
regime boundary at |
2 |
"a" |
regime below 6: insertion algebra dominates | 5 |
"Me+You--IsMyDream" |
online refutation: one adjacent pair kills the conjunction at 2299 | false |
- weak: Baaabb0 a run of three identical characters
+ strong: Baaba0 every run bounded by twoBuild your own family: take the cheapest structure that exercises one price at a time — length a multiple of 3, then plus 1, then plus 2. If two candidate formulas disagree, one member exposes it by hand arithmetic.
| Failure class | Recorded event | Closure now in force |
|---|---|---|
| Unbound driver symbol | a Racket driver called a kebab-case name the solution did not define | driver reports rank as binding evidence; rename exactly one symbol, keep the kernel |
| Broken visual asset | one progress-bar renderer returned broken images under the GitHub proxy | asset purged; only renderers verified live on GitHub remain |
| Shared bucket cursor | a fused Java loop let one cursor array serve two buffers; [-36,36] answered 0 | two cursor arrays F0 and F1; the witness stays in the trace table forever |
| Empty bucket placeholder | a vectorized Python path seeded future buckets with None; first concatenate raised TypeError | empty int64 arrays; the pure path never had the hole |
| Index bounds | run walks can overrun if the inner test is misplaced | inner loop tests the bound before every read; outer index jumps monotonically |
| Stale documentation | hand-written trees rot the moment a file moves | sections 3 and 4 are regenerated artifacts; humans write prose, machines write inventories |
Binding lesson, verbatim in spirit: a compile error that names a symbol is a driver line speaking to you. Evidence outranks convention, and the fix is one rename, not a rewrite.
- 420 · Racket — 54 / 54 testcases, 0 ms, beats 100.00 %
- 2299 · C — 201 / 201 testcases, 0 ms, beats 100.00 %, 8.37 MB
- 2035 · C — 201 / 201 testcases, 171 ms, beats 100.00 %, 9.34 MB
- 2035 · Java — 201 / 201 testcases, 197 ms, beats 99.40 %, memory beats 100.00 %
- 2035 · JavaScript — 201 / 201 testcases, 201 ms, beats 100.00 %
- 2035 · Python — 201 / 201 testcases, 235 ms, beats 99.76 %
- Pick the language you want to sharpen; open its dossier from the vault line.
- Read the structural fact and close the tab; predict the pipeline from memory.
- Reopen at the witness table; recompute one row by hand before looking at the answer column.
- Read the source last, and only to confirm what you already derived.
- Port the kernel to a sixth language yourself; the catalogue tells you which traps to seal first, and the vault meter gains a sixth square the day you commit it.
Tar0 registry · R1 binding from evidence · R2 proof-carrying pruning · R9 single kernel multi-alias
the map and the vault are regenerated artifacts; the prose around them is human and stays human