You are viewing a single comment's thread. Return to all comments →
Java:
public static int theLoveLetterMystery(String s) { int n = s.length(); int totalOps = 0; for (int i = 0; i < n / 2; i++) { totalOps += Math.abs(s.charAt(i) - s.charAt(n - 1 - i)); } return totalOps; }
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: