int minStartValue(int* nums, int numsSize){ int min=0,sum=0; for (int i=0; i<numsSize; i++) { sum += nums[i]; if (sum < min) min = sum; } return (1-min <=1)? 1: 1-min; }