Minimum Insertions So No Subarray Sums to Zero
Asked at Amazon · Coding Questions · Difficulty: Hard
Given an integer array `queue_messages`, the "processing burden" of any contiguous block is its sum, and it must never be zero. You may insert extra messages (any integer value) anywhere. Return the minimum number of insertions so that no contiguous block sums to zero.
Loading the problem…