You are viewing a single comment's thread. Return to all comments →
Here is how I did it in python.
n = int(raw_input()) for _ in range(n): str_ = raw_input() len_ = len(str_) for i in range(1, len_): s_diff = ord(str_[i]) - ord(str_[i - 1]) r_diff = ord(str_[len_ - i]) - ord(str_[len_ - i - 1]) if abs(s_diff) != abs(r_diff): print "Not Funny" break else: print "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 →
Here is how I did it in python.