You are viewing a single comment's thread. Return to all comments →
My solution in C#.
static string funnyString(string s) { for (int i = 0; i < s.Length / 2; i++) { int l = (s.Length - 1) - i; int a = (int)s[i]; int b = (int)s[i + 1]; int c = (int)s[l]; int d = (int)s[l - 1]; if (Math.Abs(a - b) != Math.Abs(c - d)) return "Not Funny"; } 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 →
My solution in C#.