Problem 2874 · Medium

Maximum Value of an Ordered Triplet II

Sweep the middle index, keeping the largest value before it and the largest value after it.

Open the interactive visualisation