@@ -0,0 +1,910 @@
+//https://www.hackerrank.com/challenges/sansa-and-xor%0Aimport java.io.*;%0A%0Apublic class Solution %7B%0A  public static void main(String%5B%5D args) throws IOException %7B%0A    StringBuffer sb = new StringBuffer();%0A    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A    %0A    //For each test%0A    for(byte T = Byte.parseByte(br.readLine()); T %3E 0; --T)%7B%0A      %0A      //Get input%0A      final int N = Integer.parseInt(br.readLine());%0A      final int%5B%5D arr = new int%5BN%5D;%0A      String%5B%5D line = br.readLine().split(%22 %22);%0A      for(int i = 0; i %3C N; ++i)%7B%0A        arr%5Bi%5D = Integer.parseInt(line%5Bi%5D);%0A      %7D%0A      %0A      //Get output%0A      sb.append(solve(arr, N)).append(%22%5Cn%22);%0A    %7D%0A    System.out.print(sb);%0A  %7D%0A%0A  private static int solve(final int%5B%5D A, final int N)%7B%0A    int xor = 0;%0A    if((N & 1) == 1)%7B%0A      for(int i = 0; i %3C N; i += 2)%7B%0A        xor %5E= A%5Bi%5D;%0A      %7D%0A    %7D%0A    return xor;%0A  %7D%0A%7D%0A

Create sansa-and-xor.java