Given an array of integers&nbsp;nums, you start with an initial positive value startValue.

In each iteration, you calculate the step by step sum of startValue&nbsp;plus&nbsp;elements in nums&nbsp;(from left to right).

Return the minimum positive value of&nbsp;startValue such that the step by step sum is never less than 1.

&nbsp;
Example 1:

Input: nums = [-3,2,-3,4,2]
Output: 5
Explanation: If you choose startValue = 4, in the third iteration your step by step sum is less than 1.
step by step sum
startValue = 4 | startValue = 5 | nums
  (4 -3 ) = 1  | (5 -3 ) = 2    |  -3
  (1 +2 ) = 3  | (2 +2 ) = 4    |   2
  (3 -3 ) = 0  | (4 -3 ) = 1    |  -3
  (0 +4 ) = 4  | (1 +4 ) = 5    |   4
  (4 +2 ) = 6  | (5 +2 ) = 7    |   2


Example 2:

Input: nums = [1,2]
Output: 1
Explanation: Minimum start value should be positive. 


Example 3:

Input: nums = [1,-2,-3]
Output: 5


&nbsp;
Constraints:


	1 &lt;= nums.length &lt;= 100
	-100 &lt;= nums[i] &lt;= 100


class Solution:
    def minStartValue(self, nums: List[int]) -> int:
        return max(1, 1 - min(accumulate(nums)))
class Solution {
    public int minStartValue(int[] nums) {
        int lowest_sum = 0;
        int sum = 0;
        for(int i=0; i<nums.length; i++) {
            sum += nums[i];
            if(lowest_sum > sum) {
                lowest_sum = sum;
            }
        }
        return 1-lowest_sum;
    }
}
class Solution {
public:
    int minStartValue(vector<int>& nums) {
        int result=min(nums[0],0);
        for(int i=1;i<nums.size();i++){
            nums[i]+=nums[i-1];
            result = min(result,nums[i]);
        }
        return abs(result)+1;
    }
};
var minStartValue = function(nums) {
    var min = 1;
    var sum = 0;
	
    for(var i=0;i<nums.length;i++){
        sum = sum+nums[i];
        min = Math.min(min,sum);
    }
    if(min == 1){
        return min;
    }
	// add 1 to negative of min value obtained to keep the sum always positive
    return (-1*min)+1;
};
Minimum Value to Get Positive Step by Step Sum