Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1413. Minimum Value to Get Positive Step by Step Sum
Find the smallest positive startValue such that when added to the running sum of nums (prefix sums), every cumulative total stays at least 1. This reduces to scanning the array for the minimum prefix sum and choosing startValue = max(1, 1 - minPrefix).
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.