The Question
CodingMinimum Increments for Circular Peaks
Given a circular integer array `nums` of length $n$, an index $i$ is defined as a peak if `nums[i]` is strictly greater than both its circular neighbors. You can increase any element `nums[i]` by 1 at the cost of 1 operation. Design an efficient algorithm to find the minimum total operations required to ensure the array contains at least $k$ peaks. If it is impossible to achieve $k$ peaks, return -1.
Python
DP
Sliding Window
Circular Array