title: Maximum xor among all subsets of an array
body: <p>I have to find maximum value of exclusive xor among the elements of subsets of an array. I have to check every subset of the array and the subset which will yield maximum xor will be the answer.  </p>
  
  <p><strong>For exapmle-</strong> let <strong>F(S)</strong> denote the fuction which takes xor over all elements of subset <strong>S</strong> of array <strong>P={1,2,3,4}</strong> </p>
  
  <pre><code>F({1,2}) = 3
  F({1,3}) = 2
  F({1,2,3}) = 0  
  F({1,4}) = 5
  F({2,3}) = 1  
  F({2,4}) = 6  
  F({3,4}) = 7  
  F({2,3,4}) = 5  
  F({1,2,3,4}) = 4`  
  </code></pre>
  
  <p><strong>Maximum of them is 7. Hence the answer is 7.</strong><em>(There are other subsets but they are not worth considering).</em> If you are about to tell me about <strong>Gaussian Elimination</strong> method, I've read that somewhere on MSE but it was not at all clear to  me.
  If gauss elimination is the only answer than please elaborate that to me or is there some method/algorithm I don't know of?</p>