Why A = [5, 5, 2, 5, 8] special value 2 in this test cases?


#1

If we delete A[0] or A[1] or A[3] , array will be balanced
(5+5) = (2+8)
So A[0] and A[1] and A[3] are special elements, so count is 3.

But it is given 2 why???


#2

If you remove A[3], the array will become:
[5,5,2,8]
Sum of even indices = 5+2=7
Sum of odd indices = 5+8=13
Hecne these are not equal.