3187. Peaks in Array
A peak in an array arr is an element that is greater than its previous and next element in arr. You are given an integer array nums and a 2D integer array queries. You have to process queries of two types: - queries[i] = [1, li, ri], determine the count of peak elements in the subarray nums[li..ri]. - queries[i] = [2, indexi, vali], change nums[indexi] to vali. Return an array answer containi
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start