Company: UKG
Difficulty: medium
Problem Title: Make Array Positive It is possible to make the array positive by performing a certain number of operations. Each operation consists of selecting an index i and a value x to add to the element at that index. Input Format The first line contains an integer n - the size of the array. The second line contains n space-separated integers representing the elements of the array arr . Output Format Print a single integer representing the minimum number of operations required to make the array positive. Constraints 1 ≤ n ≤ 100 -10 3 ≤ arr[i] ≤ 10 3 Examples Input: 6 -6 -5 5 5 10 -1 12 Output: 0 There is no need to perform any operation. Every subarray of length greater than 1 has a sum greater than or equal to 0. Input: 3 -1 10 -15 Output: 2 It is possible to make the array positive by performing 2 operations. One way is with (i = 1, x = 10) and (i = 3, x = 15). Then arr becomes [-1, 10, 15, -1].