Problem 2789 · Medium

Largest Element in an Array after Merge Operations

Scan from the right, absorbing each value into the block to its right when it is no larger than that block.

Open the interactive visualisation