package hackerrank;

/**
 * https://www.hackerrank.com/challenges/funny-string
 */
public class FunnyString {
    public static void main(String[] args) {

    }
}

@@ -14,16 +14,43 @@
 rrank;%0A%0A
+import java.util.Scanner;%0A%0A
 /**%0A * h
@@ -139,48 +139,652 @@
    p
-ublic static void main(String%5B%5D args) %7B%0A
+rivate static String funnyString(String str) %7B%0A        for (int i = 0, j = str.length() - 1; i %3C str.length() - 1; i++, j--) %7B%0A            int a = Math.abs(str.charAt(i) - str.charAt(i + 1));%0A            int b = Math.abs(str.charAt(j) - str.charAt(j - 1));%0A            if (a != b) %7B%0A                return %22Not Funny%22;%0A            %7D%0A        %7D%0A        return %22Funny%22;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int testCases = in.nextInt();%0A%0A        for (int t = 0; t %3C testCases; t++) %7B%0A            String str = in.next();%0A            System.out.println(funnyString(str));%0A        %7D
 %0A   

Solve Funny String