The sum of subarray from to is . You want this to be at least .
For each , you're looking for the largest such that , which means .
If where , then is never useful. Any that could use could use instead and get a shorter subarray. This "dominated" insight means you can use a monotonic deque.