Problem 3952 · Medium

Maximum Total Value of Covered Indices

Each token either stays put or steps one place left. Count every occupied index once and keep the best total with a two-state scan.

Open the interactive visualisation