Problem 3413 · Medium

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.

Open the interactive visualisation