You are viewing a single comment's thread. Return to all comments →
static int theLoveLetterMystery(String s) {
int count = 0; int i = 0; int j = s.length() -1; while(i < j){ int start = s.charAt(i); int end = s.charAt(j); int diff = Math.abs(start - end); count = count + diff; i++; 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 →
static int theLoveLetterMystery(String s) {