50. MonoDeque single constructor and Bitset.subset_sums (2026-11-21)
MonoDeque<T>.new(by: (T, T) -> T = min)replaces the two-constructornew(pick)+by(better)split, storesbydirectly without wrapping in a lambda, and addsbest_at -> ?Intanddrop_after(max_at: Int). Reason: options are named arguments rather than separate constructors; storingbyas-is lets C++ codegen inlinemin/maxdirectly (~2x faster than wrappingpickin a lambda);best_atsupplies DP argmin in O(1);drop_after(max_at)mirrorsdrop_before(min_at)for right-to-left sweeps without negating positions or adding state toMonoDeque(research/frictions/ucup4s24f.md). Reverse: restoreMonoDeque.by(better: (T, T) -> Bool)besidenew(pick)and dropbest_at/drop_after.- Bitset knapsack is
Bitset<D>.subset_sums(weights)rather than a freestd.bitset.subset_sums. Reason: avoids colliding withstd.dp.subset_sums(xs) -> List<Int>(meet-in-the-middle) and eliminates the turbofish at call sites (Bitset<Sum>.subset_sums(ws)). Reverse: expose a freesubset_sums<D>instd.bitset.