Problem 2593 · Medium

Find Score of an Array After Marking All Elements

Repeatedly take the smallest unmarked value, then mark it and its two neighbours, adding only the value taken.

Open the interactive visualisation