You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution to the problem, explanation here : https://youtu.be/gIUqS2xO6lg
int theLoveLetterMystery(string s) { int ans = 0 , start = 0, end = s.size() - 1; while(start < end){ ans += abs(s[start] - s[end]); start++; end--; } return ans; }
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 →
Here is my c++ solution to the problem, explanation here : https://youtu.be/gIUqS2xO6lg