You are viewing a single comment's thread. Return to all comments →
def funnyString(s): # Write your code here start = 0 end = len(s) - 1 while start < (len(s) - 1) and end > 0: first = abs(ord(s[start]) - ord(s[start + 1])) second = abs(ord(s[end]) - ord(s[end - 1])) if first != second: return "Not Funny" start += 1 end -= 1 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 →