Question
Dual Threshold Window
Find the minimum length of a contiguous subarray whose sum is at least
Input
First line: KaTeX can only parse string typed expression.
Second line: the array.
Output
Print the minimum valid length, or KaTeX can only parse string typed expression.
Example
Input:
[5,6,3,8] has sum 22 and two odd values; no shorter window satisfies both conditions.
7 15 2
2 4 5 6 3 8 1Output:4Explanation:[5,6,3,8] has sum 22 and two odd values; no shorter window satisfies both conditions.