Problem 3356 · Medium

Zero Array Transformation II

Add each query to a supply array in order; the first prefix of queries whose supply covers every value is the answer.

Open the interactive visualisation