You are given a circular integer array nums of length n and an integer k.
An element nums[i] is considered a peak if it is strictly greater than both of its adjacent neighbors, nums[(i - 1 + n) % n] and nums[(i + 1) % n].
In one operation, you can choose any index i and increment nums[i] by
Return the minimum total number of operations required to make the array contain at least k peaks. If it is impossible to have at least k peaks, return
Constraints:
nums.length
nums[i]
You are given a circular integer array nums of length n and an integer k.
An element nums[i] is considered a peak if it is strictly greater than both of its adjacent neighbors, nums[(i - 1 + n) % n] and nums[(i + 1) % n].
In one operation, you can choose any index i and increment nums[i] by
Return the minimum total number of operations required to make the array contain at least k peaks. If it is impossible to have at least k peaks, return
Constraints:
nums.length
nums[i]