


An array is called good if the sum of elements in odd indexes is equal to the sum of elements in even indexes.
In array A= [1 2 4 3 6], if we delete A[4]=6, we will get new array B= [1 2 4 3], where B[0] + B[2] = B[1] + B[3] = 5, which means array B is good.
The first line of the input contains ‘T’ denoting the number of test cases.
The first line of each test case contains the three integers N, length of the array.
The second line of each test case contains N space-separated integers of the array A.
For each test case, print an integer denoting the number of good arrays that can be formed.
You do not need to print anything, it has already been taken care of. Just implement the given function
1 <= T <= 5
1 <= N <= 3000
-5000 <= A[i] <= 5000
Where 'A[i]' denotes the 'ith' element of the given array.
Time Limit: 1sec
Explanation:
In this approach, we will delete all index values one by one and make a new array after deleting. Then in the new array, we just check the sum of elements in even and odd index and compare them.
Algorithm:
Explanation:
‘leftEvenSum’ + ’rightOddSum’ == ‘leftOddSum’ + ‘rightEvenSum’.
Algorithm: