You are viewing a single comment's thread. Return to all comments →
Here is my simple c++ solution, video explanation here : https://youtu.be/gcNAo9voHvk.
string funnyString(string s) { string r = s; reverse(r.begin(), r.end()); for(int i = 1; i < s.size(); i++){ if(abs(s[i]-s[i-1]) != abs(r[i]- r[i-1])) return "Not Funny"; } return "Funny"; }
Seems like cookies are disabled on this browser, please enable them to open this website
Funny String
You are viewing a single comment's thread. Return to all comments →
Here is my simple c++ solution, video explanation here : https://youtu.be/gcNAo9voHvk.