Maximum Coins From K Consecutive Bags
Coin totals change direction only where a window edge crosses a bag edge, so only those window starts need checking.
Coin totals change direction only where a window edge crosses a bag edge, so only those window starts need checking.