Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3356. Zero Array Transformation II
Given range queries that can decrement each index in their range by up to val independently, find the smallest prefix length k such that for every index the total available decrement from the first k queries covering that index is at least nums[i] (otherwise return -1). Key challenge: efficiently test prefixes — typically solved by binary searching k and using a difference/prefix-sum array (or segment tree) to accumulate query contributions.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.