For this Question: Given an N*N  matrix. Print the elements of the matrix in anticlockwise order (see the sample for better understanding).First line contains N. 
N lines follow each containing N space seperated integers.

Constraints:-
2 <= N <= 500
1 <= Mat[i][j] <= 1000Output N*N integers in a single  line separated by spaces, which are the elements of the matrix in anti-clockwise order.Sample Input
4
1 2 3 4 
5 6 7 8 
9 10 11 12 
13 14 15 16 

Sample output 
1 5 9 13 14 15 16 12 8 4 3 2 6 10 11 7 

Explanation:
We start from 1 , go down till 13 and then go right till 16 then go up till 4 , then we go left till 2 then down and so on in anti-clockwise fashion .

Sample Input 
3
1 2 3 
4 5 6 
7 8 9 

Sample output
1 4 7 8 9 6 3 2 5
, I have written this Solution Code: import java.util.*;
import java.lang.*;
import java.io.*;
class Main{
    public static void main(String args[])throws IOException{
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        int x, y, start, end, num=n, firstcond, secondcond, thirdcond, fourthcond, flag;
        if(n%2!=0)
            num++;
        num = num/2;
        int[][] a = new int[n][n];
        for(x=0; x<n; x++){
            String nextLine[] = in.readLine().split(" ");
            for(y=0; y<n; y++){
              a[x][y] = Integer.parseInt(nextLine[y]);
            }
        }
        start = 0;
        end = n-1;
        while(num>=1){
            flag=0;
            firstcond = secondcond = thirdcond = fourthcond = 1;
            for(x=start, y=start;
                (firstcond==1 || secondcond==1 || thirdcond==1 || fourthcond==1) && (x>=start && y>=start && x<=end && y<=end);
                ){
                System.out.print(a[x][y] + " ");
                if(firstcond==1){
                    x++;
                    if(x==end+1){
                        firstcond=0;
                        x--;
                        y++;
                    }
                }else if(secondcond==1){
                    y++;
                    if(y==end+1){
                        secondcond=0;
                        y--;
                        x--;
                    }
                }else if(thirdcond==1){
                    x--;
                    if(x==start-1){
                        if(flag==0)
                            break;
                        thirdcond=0;
                        x++;
                        y--;
                    }
                    flag=1;
                }else{
                    y--;
                    if(y==start){
                        fourthcond=0;
                        x++;
                        y++;
                    }
                }
            }
            start++;
            end--;
            num--;
        }
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?