Problem 3912 · Easy
Compare exclusive left and right maxima to keep valid elements in their original order.
Open the interactive visualisation