You are viewing a single comment's thread. Return to all comments →
Javascript solution:
function funnyString(s) { for (let i = 0; i < s.length - 1; i++) { if ( Math.abs(s.charCodeAt(i) - s.charCodeAt(i + 1)) !== Math.abs(s.charCodeAt(s.length - i - 1) - s.charCodeAt(s.length - i - 2)) ) { 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 →
Javascript solution: