You are viewing a single comment's thread. Return to all comments →
int j=s.length()-1; int x; int y; int count=0; for(int i=0;i<s.length()/2;i++){ if(s.charAt(i)!=s.charAt(j)){ x=s.charAt(i); y=s.charAt(j); count +=Math.abs(x-y); j--; }else{ j--; } } return count;
Seems like cookies are disabled on this browser, please enable them to open this website
The Love-Letter Mystery
You are viewing a single comment's thread. Return to all comments →
Java