Available question text
Count how many hills and valleys appear in an array, where a position (or contiguous block of equal values) is a hill if its value is greater than the nearest non-equal neighbors on both sides and a valley if it is smaller than those neighbors; positions with no non-equal neighbor on either side are ignored.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2210. Count Hills and Valleys in an Array
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source