A three-instruction leap-year test hides the constants 1073750999, 3221352463, and 126976. I rebuilt an 18-bit version with Z3, then traced how the multiply, mask, and threshold encode divisibility by 4, 100, and 400.
Benchmarked on an M4 Mac mini: Ben Joffe's 2-instruction weekday hack beats plain %7 by 1.6-6.4x in clang, Rust, and V8, loses 3x in CPython. Plus a 25x V8 -0 deopt trap.
A comprehensive walkthrough of data structures used in search tasks like dictionary lookup, full‑text search, and autocomplete. Summarizes how 10 structures work and when to use them—including Trie, Double‑Array Trie, Inverted Index, Suffix Array, B+ tree, and LSM tree.