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.
for r in xrange(int(raw_input())):
N = raw_input()
S = N[::-1]
print 'Funny' if all((abs(ord(N[i]) - ord(N[i - 1])) == abs(ord(S[i]) - ord(S[i - 1]))) for i in xrange(1, len(N))) else '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 code works