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.
Add each query to a supply array in order; the first prefix of queries whose supply covers every value is the answer.