Why Left Never Backs Up

A sliding window is correct only when the left pointer never needs to move backwards. Stated as a property of the predicate that decides whether a window is acceptable, what is that requirement?

A

The answer must be a contiguous subarray rather than a subsequence

B

If a window is unacceptable, every window that contains it is also unacceptable

C

The array values must all be positive

D

The array must be sorted, so that the window sum grows with the right endpoint