Available question text
Given an array where a "peak" is an element greater than its immediate neighbors, process up to 1e5 queries that either update a single element or ask for the number of peaks in a subarray. The challenge is to support fast point updates and range peak-count queries (updates only affect a constant local neighborhood), so use a dynamic range-sum structure (e.g., segment tree/Fenwick) over peak indicators.
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 3187. Peaks in Array
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source