You are given an integer array nums of length k.
An index p (where nums[p] > nums[p - 1] and nums[p] > nums[p + 1].
A subarray starting at index l and ending at index r (where
It contains exactly p.
The distance from the peak p to each boundary is at most k, meaning
Return the total number of valid subarrays.
Constraints:
nums.length
nums[i]
k
You are given an integer array nums of length k.
An index p (where nums[p] > nums[p - 1] and nums[p] > nums[p + 1].
A subarray starting at index l and ending at index r (where
It contains exactly p.
The distance from the peak p to each boundary is at most k, meaning
Return the total number of valid subarrays.
Constraints:
nums.length
nums[i]
k