hills-valleys-two-pass-tradeoff

Status: IN

`count_hills_and_valleys` uses O(n) auxiliary space for the `deduped` list (two-pass: dedup then scan); a single-pass approach tracking `prev_different` could reduce to O(1) space.

Source: entries/2026/06/06/count-hills-and-valleys-in-an-array-solution.md

JSON