I have already solved this question but i think the question is not correct. It is given 1<=a<=b<=c<=d<=N. If this is the case consider a = 1, b = 4, c = 4, d = 4 in the given test case (1 based indexing), the answer will be 22.
Question not correct
@17uec133,
I don’t think so,
(arr[1] ^ arr[2] ^ arr[3] ^ arr[4]) + (arr[4] ^ arr[4]) = (1 ^ 2 ^ 6 ^ 8) + (8 ^ 8) = 13 + 0 = 13