You are given n integers A1,A2,…,An. Let N={1,2,…,n}.
For a subset I of N, define SI as follows.
SI=∑k∈IAk
That is, SI adds up Ak over every index k that belongs to I. The empty subset has sum 0, and N itself counts as a subset, so there are 2n values SI in total.
Let X be the bitwise exclusive or of all 2n values.
X=⨁I⊆NSI
Compute X.