Problem 2909 · Medium

Minimum Sum of Mountain Triplets II

Treat each index as the peak j; take the smallest valid value on its left and its suffix minimum on the right.

Open the interactive visualisation