hills-valleys-boundary-exclusion

Status: IN

The counting loop iterates indices `1` through `len(deduped) - 2`, so the first and last elements are never counted as hills or valleys — they lack a second neighbor.

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

JSON