Problem 2567 · Medium

Minimum Score by Changing Two Elements

Sort the values, then take the best of three candidate ranges after changing the two outermost values.

Open the interactive visualisation