You are given a nums and an integer k.
For each index i (nums.length), the instability score is defined as the maximum value in the subarray from index i minus the minimum value in the subarray from index i to nums.length
An index i is considered stable if its instability score is less than or equal to k.
Return the smallest stable index i. If no such index exists, return
Constraints:
nums.length
nums[i]
k
You are given a nums and an integer k.
For each index i (nums.length), the instability score is defined as the maximum value in the subarray from index i minus the minimum value in the subarray from index i to nums.length
An index i is considered stable if its instability score is less than or equal to k.
Return the smallest stable index i. If no such index exists, return
Constraints:
nums.length
nums[i]
k