We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
lst1 = [abs(ord(s[i]) - ord(s[i-1])) for i in range(1, len(s))]
lst2 = [abs(ord(s2[i]) - ord(s2[i-1])) for i in range(1, len(s2))]
if lst1 == lst2:
return 'Funny'
else:
return 'Not Funny'
Cookie support is required to access HackerRank
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 →
My Python code
def funnyString(s): s2 = s[::-1]