solulubeta
Sign in
Story Problems / Arrays, windows & two pointers
01.12 · Problem

Longest Hill on the Trek

Medium Single pass / expand from a peak Pro

This problem is part of solulu Pro

A trekker has the elevation reading at each kilometre. A *hill* is a section of at least 3 points that strictly rises to a peak and then strictly falls. Return the length of the longest hill (0 if there is none).

Lifetime ₹2,000 ₹1,000 · Beta offer
Mark this problem as solved when you are finished.

Item 12 of 94 · updated 2026-10-12