Taking error need assistance

question :- http://www.hackerearth.com/eksmscom-hiring-challenge/algorithm/inverse-list/
answer :-

public static void main(String args[] ) throws Exception 
{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int ctr=0;
    int t=Integer.parseInt(br.readLine());
    for(int i=0;i<t;i++)
    {
    	int n=Integer.parseInt(br.readLine());
    	String input[]=(br.readLine()).split(" ");
    	for(int j=0;j<n;)
    	{
    		if(Integer.parseInt(input[j]) == ++j)
    		{
    			ctr++;
    		}
    	}
    	if(ctr==n)
    	{
    		
    		System.out.println("inverse"); 
    	}
    	else
    	{
    		
    		System.out.println("not inverse");
    	}
    	ctr=0;
    }
}

}


Though too trivial, the solution is shown correct when i compile and run, but on submitting, it gives WA.

Your answer is wrong.

The inverse list of [2 1] is also [2 1]. So, the program should output “inverse” for this test case. But your pgm will output “not inverse”.

//