@@ -0,0 +1,1494 @@
+//https://www.hackerrank.com/challenges/xoring-ninja%0Aimport java.io.*;%0A%0Apublic class Solution %7B%0A    %0A    final static int MOD = 1000000007;%0A    %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 case%0A        for(byte T = Byte.parseByte(br.readLine()); T %3E 0; --T)%7B%0A            %0A            //Get input set%0A            final int%5B%5D A = new int%5BInteger.parseInt(br.readLine())%5D;%0A            int N = 0;%0A            for(String a : br.readLine().split(%22 %22))%7B%0A                A%5BN++%5D = Integer.parseInt(a);%0A            %7D%0A            %0A            //Get set bits%0A            int bits = 0;%0A            for(int i = 0; i %3C N; bits %7C= A%5Bi++%5D)%7B%7D%0A            %0A            //Get xorSum%0A            int xorSum = 0;%0A            for(byte i = 0; bits %3E 0; ++i)%7B%0A                if((bits & 1) == 1)%7B%0A                    xorSum = (xorSum + powMod(2, N - 1 + i, MOD)) %25 MOD;%0A                %7D%0A                bits %3E%3E= 1;%0A            %7D%0A            %0A            //Print output%0A            sb.append(xorSum + %22%5Cn%22);%0A        %7D%0A        System.out.print(sb);%0A    %7D%0A    %0A    private static int powMod(int b, int p, final int m)%7B%0A        int v = 1;%0A        while(p %3E 0)%7B%0A            if ((p & 1) == 1)%7B%0A                v = (int)((1L*v*b) %25 m);%0A            %7D%0A            p %3E%3E= 1;%0A            b = (int)((1L*b*b) %25 m);%0A        %7D%0A        return v;%0A    %7D%0A%7D%0A

Create xoring-ninja.java