LeetCode 209 promises a[i] > 0. LeetCode 862 does not, and that single missing
guarantee is the entire problem. With only positives, growing the window can only raise the sum
and shrinking can only lower it — so shrink while still valid is safe, because the
first left that breaks validity is the last one worth trying. Put one negative in the array and
shrinking from the left can raise the sum, so that rule stops early and throws away a
candidate it should have kept. Act 1 runs the 209 window and lets it return the wrong
length. Act 2 throws the window away: prefix sums plus a
monotonic deque of indices kept increasing in prefix value.
sum >= k is not, so the deque replaces the left pointer with
all the left candidates still worth keeping.