I approached the problem by realizing I need to ensure each index i in nums is decremented at least nums[i] times. I used a difference array to simulate how many times each index is affected by the remaining queries. Then, I binary searched on the number of queries I could safely remove while still converting nums into a zero array. 486 / 824 testcases passed.
Then the editorial
