You are viewing a single comment's thread. Return to all comments →
In Cpp
int theLoveLetterMystery(string s) { int count = 0; for (int i=0; i<s.length()/2; i++) { if(s[i] != s[s.length()-1-i]){ int first = static_cast<int>(s[i]); int sec = static_cast<int>(s[s.length()-i-1]); int res = abs(first - sec); count += res; } } 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 →
In Cpp