You are given an array of N elements. You can perform the below operation atmost one time.
Operation :
You can pick any element of the array and change it to zero.
You are required to maximise number of partition of the given array such that after the partition the sum of the first subarray is equal to sum of another subarray.
Note: In this problem, the partition of the array is defined as dividing the given array into two contiguous subarrays Any of the two subarrays in the partition can't be empty.
Sample input
1
6
-1 5 0 0 5 0
Output
3
Explanation
For the above input,change -1 to 0. Therefore,there will be 3 such partitions: [0, 5] [ 0, 0, 5, 0],
[0, 5, 0] [0, 5, 0] and [0, 5, 0, 0] [5, 0].
Can anyone provide approach for this problem?