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