changes and two integers min_len and max_len. Consider every contiguous slice of the array whose length is between min_len and max_len inclusive and whose sum is **strictly greater than zero**.
Return the smallest such sum, or -1 if no slice qualifies.changes=[4, -3, 2, -2, 5], min_len=2, max_len=3 → 1
The slice [4, -3] sums to 1; no slice of length 2 to 3 has a smaller positive sum.
changes=[-5, 1, -4], min_len=1, max_len=3 → 1
The only slice with a positive sum is [1].
changes=[-1, -1, 0], min_len=2, max_len=3 → -1
changes=[4, -3, 2, -2, 5], min_len=2, max_len=3
1
Run checks the first 3 tests in your browser. Submit checks all 116 tests on the server, hidden ones included.