@@ -0,0 +1,688 @@
+package hackerrank.string.funnystring;%0A%0Aimport java.util.Scanner;%0A%0A/**%0A */%0Apublic class Solution %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        try (Scanner in = new Scanner(System.in)) %7B%0A            int num = Integer.parseInt(in.nextLine());%0A            while (num-- %3E 0) %7B%0A                System.out.println(isFunny(in.nextLine()) ? %22Funny%22 : %22Not Funny%22);%0A            %7D%0A        %7D%0A    %7D%0A%0A    private static boolean isFunny(String str) %7B%0A        char%5B%5D c = str.toCharArray();%0A        for (int i = 1, len = str.length(); i %3C len; i++)%0A            if (Math.abs(c%5Bi%5D - c%5Bi - 1%5D) != Math.abs(c%5Blen - i - 1%5D - c%5Blen - i%5D))%0A                return false;%0A        return true;%0A    %7D%0A%0A%7D%0A

funny string