You are given an integer array nums and an integer k.
For each index i where nums.length, the instability score is defined as the difference between the maximum value in the subarray from index i inclusive and the minimum value in the subarray from index i to nums.length
Return the smallest index i such that the instability score at index i is less than or equal to k. If no such index exists, return
Constraints:
nums.length
nums[i]
k
You are given an integer array nums and an integer k.
For each index i where nums.length, the instability score is defined as the difference between the maximum value in the subarray from index i inclusive and the minimum value in the subarray from index i to nums.length
Return the smallest index i such that the instability score at index i is less than or equal to k. If no such index exists, return
Constraints:
nums.length
nums[i]
k