186. Rebuild holes, batch 4: one spelling per library job (2026-11-21)
- Decision. Prefix sums and Fenwick trees answer
fold(r)(their stubs'sumis renamed), matchingseg.fold(r); structures that keep several aggregates (BeatsSegTree,SortedSet) keep named queries likesum. Substring and element search on strings iss.search(p)/s.rsearch(p)withpaStrorChar, returning a key, sincefind/rfindtake a predicate (decision 182) and the language has no overloading.collect()builds a new sequence keyed from 0, likesorted()(182); keep keys with[w.keys] k => w[k].w.rebasereturnsRebased<S>.Dsu.sametakes a readself, likefind(its parent array is@cache). Segment trees take the operation and the initial array positionally:SegTree(op, a). Closures of different types never share a container; nothing lowers tostd::function.v.afterandv.beforeare the pieces after and before a position.spec/GLOSSARY.mdandspec/diagnostics.mdare normative. - Why. Holes H-PREFIX-API, H-STR-FIND-STUB, H-COLLECT-KEYS, H-REBASE-STUB-FORM, H-DSU-SAME-MUT, H-SEGTREE-DOMAIN-ARG, H-STD-FUNCTION, H-POSITIONS-AFTER and H-DIAG-CODES: each job had two or three spellings across chapters and stubs.
searchfollows C++'sstd::searchfor subsequences. - Reverse. Rename back; allowing
findto take a pattern needs overloading by argument type, which the language bans.