Problem 3018 · Medium

Maximum Number of Removal Queries That Can Be Processed I

Pick a subsequence of nums, then strip values from either end to match each query in order; track every surviving window to see how far the queries reach.

Open the interactive visualisation