For this Question: Given n and m and a matrix of size n x m. print sum of XOR of all SEPERATED ELEMENT.
A element a is said to be SEPERATED element from an element B if a will not share any side with b or vice versa.first line contain two element n and m.
next n line contains m space separated integer i. e. element of matrix.

Constraints:
1<=n,m<=100print sum of XOR.Sample input 1:
3 4
1 2 3 4
2 3 4 5
3 4 5 6
Sample Output 1:
4

Explanation:
XOR of first part of SEPERATED ELEMENTS is 2.
XOR of second part of SEPERATED ELEMENTS is 2.
sum of both part equal to 4., I have written this Solution Code: import java.util.*;
class Main {
	private static int Max_Xor(int[][] mat,int n, int m)
	{
		int sum1=0,sum2=0;
		for(int i=0;i<n;i++){
			for(int j=0;j<m;j++){
			if((i+j)%2==1)
			sum1^=mat[i][j];
			else sum2^=mat[i][j];
			}
		}
		return sum1+sum2;
	}

	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		int n,m;
        n=sc.nextInt();
		m=sc.nextInt();
		int [][]arr=new int[n][m];

		for(int i=0;i<n;i++)
		for(int j=0;j<m;j++)
        arr[i][j]=sc.nextInt();

		System.out.print(Max_Xor(arr, n, m));
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?