372. Missax !!link!! «Editor's Choice»
Inductive step : Assume the invariant holds after processing a₁,…,a_i‑1 . When processing a_i , any feasible extension must end with a value v that satisfies the monotonicity and Δ‑gap constraints. By the inductive hypothesis, the tree already stores the optimal length ℓ(v) for each such v . The RMQ returns