{"id":"hills-valleys-boundary-exclusion","text":"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.","truth_value":"IN","source":"entries/2026/06/06/count-hills-and-valleys-in-an-array-solution.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"hills-valleys-boundary-exclusion","truth_value":"IN","reason":"premise"}]}}