Problem 2640 · Medium

Find the Score of All Prefixes of an Array

Track the running maximum and add each converted value to a running score, which gives every prefix score in one pass.

Open the interactive visualisation