Problem intuition
- The brute-force version starts a new sum from every index and checks all possible endings.
- The sliding-window solution takes advantage of positive numbers: once the sum is large enough, shrinking from the left is the only way to improve the answer.