we are given an Array
Array size <= 10^4 .
0 <= A[i] <= 15
We need to partition the array into 4 subsets (each subset can have zero or more elements ). Take xor of each subset and sum those xors.
for example, one subset could have indices 0, 3, and 7, and another subset could have indices 1, 2, and 4 find the max sum.
4^n approach is very expensive.
there are only 16 different values of xor so for each value of xor=X we can search in array if is it possible to partition the array such that we get xor=X.