You are viewing a single comment's thread. Return to all comments →
simple approach in python:
def funnyString(s): ns=[abs(ord(s[i])-ord(s[i+1])) for i in range(0,len(s)-1,1)] rns=[abs(ord(s[i])-ord(s[i-1])) for i in range(len(s)-1,0,-1)] return 'Funny' if ns ==rns else 'Not 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 →
simple approach in python: