📜 WAYPOINT LESSON
Checkpoint — The Living Maximum
⭐⭐⭐ advanced⏳ 25 min read📍 Lesson 233 of 281
Range max under interleaved updates: segment tree O((n+q) log n) vs the naive O(n·q) rescan. The W is correct code in the wrong complexity family — the budget law's canonical victim.
Checkpoint — The Living Maximum. Interleaved point-updates and range- max queries: static prefix arrays die at the first update; the honest structure is an iterative segment tree (O((n + q) log n)). The W is the instructive baseline: fully correct, passes every small test, and dies at full scale because O(n·q) = 4·10^10. This module's contract: when the W fails only on the big test, the lesson is the complexity family — the code was never the point.