Problem 3282 · Medium

Reach End of Array With Max Score

Every position pays the largest value seen so far, so the score is a running maximum summed over all positions before the last.

Open the interactive visualisation