Problem 1299 · Easy

Replace Elements with Greatest Element on Right Side

Replace each element with the greatest element strictly to its right.

Open the interactive visualisation