given an array of n integers,make the array positive with following operation: in 1 opr select any i(0<=i<n) and x(-10e8 <=x<= 10e8) and change arr[i] to x. an array is positive when sum of each subarray of length greater than 1 is non negative . determine minimum opr required to make the array positive
input : [2, 5, -8, -1, 2]
for this we took i=2 (-8) and x =10 so array becomes [2, 5, 10, -1, 2] so now it is positive .
another test case is : 5 -1 -1 -1 -1 -1 -1 for this ans is 3.
contrainsts are : 1<=n<=10e5
-10e9<=arr[i]<=10e9