You are given a nums of length n and an positive integer k.
An index i is considered a good index if it satisfies the following conditions:
k i n k
The k elements immediately preceding index i are in non increasing order: nums[i - k] nums[i - k + 1] nums[i - 1]
The k elements immediately following index i are in non decreasing order: nums[i + 1] nums[i + 2] nums[i + k]
Return a list of all good indices sorted in increasing order.
Constraints:
n == nums.length
n
nums[i]
k n
You are given a nums of length n and an positive integer k.
An index i is considered a good index if it satisfies the following conditions:
k i n k
The k elements immediately preceding index i are in non increasing order: nums[i - k] nums[i - k + 1] nums[i - 1]
The k elements immediately following index i are in non decreasing order: nums[i + 1] nums[i + 2] nums[i + k]
Return a list of all good indices sorted in increasing order.
Constraints:
n == nums.length
n
nums[i]
k n