codechef.com/problems/MATPAN.Why this code is giving run-time error

Can any one explain me why this code is giving run-time error

import java.util.Scanner;

class Code
{

public static void main(String arg[])
{
	Scanner in=new Scanner(System.in);
	int total=0,input=in.nextInt();
	int arr[]=new int[26];
	String s;
	char arr2[];
	while(input!=0)
	{
		
		for(int j=0;j<26;j++)
		{
			System.out.print(j+1+" ");
			arr[j]=-1;
		}
	  	System.out.println();
		s=in.next();
		arr2=s.toCharArray();
		for(int j=0;j<arr2.length;j++)
			arr[Integer.valueOf(arr2[j])-97]=Integer.valueOf(arr2[j]);
		for(int j=0;j<26;j++)
		{
			if(arr[j]==-1)
				total=total+(j+1);	
		}
		System.out.println("\n"+total+"\n");
		input--;
		total=0;
	}
}

}

what run time error you are getting on this problem ? go to my submissions page and hover the cursor over runtime error logo it will show the type of error ??

You are not taking input properly… after giving number of testCases, value of each character is given in next line not string. But you are taking string input just after taking input of number of testCases. Which is causing s = 1 for sample test case given in question. Try with sample testCases given in question.

Hope this will help…

brother this code is working in my pc.

//