Best Window of Size K — Solution & Editorial
Compute the first window's sum, then slide: add the entering element, subtract the leaving one.
Complexity: O(N)
Compute the first window's sum, then slide: add the entering element, subtract the leaving one.
Complexity: O(N)