Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3187. Peaks in Array
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.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.