← 返回 meta 的题目列表Minimum Length of Subarray with Min-Max Difference
类型:online_judge
Given an integer array and an integer k, find the minimum length of a subarray such that the difference between the maximum value and the minimum value of the subarray is greater than or equal to k. Please implement this function and provide a time complexity analysis. Provide at least three test cases, with array lengths up to 10^5.
Example
Input
7 10
1 3 6 4 2 7 5