arrayscomplexitydsa
A sliding window needs a monotone condition
Anonymous
for nonnegative numbers and a positive target, a shortest subarray with sum at least the target can be found with a variable window: extend the right edge, then while the sum is at least the target, record the length and move the left edge. Each index enters and leaves once, so the scan is O(n). If negative values are allowed, this window rule is not valid.
0