why wrong answer is giving even if i am getting expected outputs on every test cases For Lapindrom problem?
Code :LAPIN
/* package codechef; // don’t place package name! */
import java.util.;
import java.lang.;
import java.io.*;
/* Name of the class has to be “Main” only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
String S="", S1="",S2="";
int n=0;
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
for(int i=1;i<=n ;i++)
{
S = sc.next();
S1 = S.substring(0,S.length()/2);
if(S.length()%2 == 0)
S2 = S.substring(S.length()/2,S.length());
else
S2 = S.substring(S.length()/2 + 1,S.length());
if(calAscii(S1) == calAscii(S2))
System.out.println("Yes");
else
System.out.println("No");
}
}
static int calAscii(String S)
{
int sum =0;
for(int i =0 ;i<S.length();i++)
{
sum += S.codePointAt(i);
}
return sum ;
}
}