Search
⌘K

Leetcode 2599. Make the Prefix Sum Non-negative

Given an integer array, determine the minimum modifications needed so that every prefix sum is non-negative — a problem about controlling running sums by selectively altering or postponing large negative contributions. Typical solutions use a greedy strategy (often with a priority queue) to handle negative elements that would make the prefix go below zero.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.