For this Question: You are given an array A of even length N consisting of non-negative integers. You need to make each element of the array equal to zero, by doing some number of moves (possibly zero).

In a single move, you can choose two integers l and r such that 1 &le; l &le; r &le; N. Let x = A[l] &oplus; A[l+1] &oplus; A[l+2] ... A[r], where &oplus; represents xor operator. Then, replace the whole subarray with x. In other words, assign A[i] = x for l &le; i &le; r.

Print the minimum number of moves required to make the entire array zero.The first line of the input contains a single integer T – the number of test cases.
Then T test cases follow, each test case in the following format:
The first line contains a single integer N – the length of array A.
The next line contains N space-separated integers representing the elements of the array A.

<b>Constraints:</b>
1&le; T &le; 50
1 &le; N &le; 10<sup>3</sup>
0 &le; A[i] &le; 10<sup>9</sup>
N is even.Output T lines, the i<sup>th</sup> line containing a single integer – the answer to the i<sup>th</sup> test case.Sample Input:
2
2
2 2
4
7 1 2 0

Sample Output:
1
2, I have written this Solution Code: import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;


public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "@debanjandhar12", 1 << 29);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            InputReader in = new InputReader(inputStream);
            OutputWriter out = new OutputWriter(outputStream);
            ArrayXor solver = new ArrayXor();
            int testCount = Integer.parseInt(in.next());
            for (int i = 1; i <= testCount; i++)
                solver.solve(i, in, out);
            out.close();
        }
    }

    static class ArrayXor {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int[] a = in.readIntArray(n);

            boolean ansIs0 = true;
            for (int i = 0; i < n; i++) {
                if (a[i] != 0) {
                    ansIs0 = false;
                    break;
                }
            }
            if (ansIs0) {
                out.printLine(0);
                return;
            }

            int xor = 0;
            for (int i = 0; i < n; i++) {
                xor ^= a[i];
            }
            if (xor == 0) {
                out.printLine(1);
                return;
            }

            out.printLine(2);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int[] readIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = readInt();
            }
            return array;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                if (Character.isValidCodePoint(c)) {
                    res.appendCodePoint(c);
                }
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            return readString();
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?