Files
rose-ash/plans
giles cccef832d9
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 25s
ocaml: phase 5.1 manacher.ml baseline (longest palindrome "babadaba" = 7)
Manacher's algorithm: insert # separators (length 2n+1) to unify
odd/even cases, then maintain palindrome radii p[] alongside a
running (center, right) pair to skip work via mirror reflection.
Linear time.

  manacher "babadaba" = 7   (* witness: "abadaba", positions 1..7 *)

Note: requires parenthesizing the if-expression on the rhs of <-:

  p.(i) <- (if pm < v then pm else v)

Real OCaml parses bare `if` at <-rhs since the rhs is at expr
level; our parser places <-rhs at binop level which doesn't include
`if` / `match` / `let`. Workaround until we relax the binop
RHS grammar.

149 baseline programs total.
2026-05-10 05:58:05 +00:00
..