@@ -0,0 +1,2037 @@
+package thirty_days_of_code;%0D%0A%0D%0Aimport java.util.Scanner;%0D%0A%0D%0A/*%0D%0A * Problem Statement: %0D%0A * Suppose you have a string S which has length N and is indexed from 0 to N-1.%0D%0A * String R is the reverse of the string S. The string S is funny if the%0D%0A * condition %7CSi-Si-1%7C=%7CRi-Ri-1%7C is true for every i from 1 to N-1.%0D%0A * %0D%0A * (Note: Given a string str, stri denotes the ascii value of the ith character%0D%0A * (0-indexed) of str. %7Cx%7C denotes the absolute value of an integer x)%0D%0A * %0D%0A * Input Format: %0D%0A * First line of the input will contain an integer T. T testcases follow. Each%0D%0A * of the next T lines contains one string S.%0D%0A * %0D%0A * Constraints: %0D%0A * 1 %3C= T %3C= 10%0D%0A * 2 %3C= length of S %3C= 10000%0D%0A * %0D%0A * Output Format: %0D%0A * For each string, print Funny or Not Funny in separate lines.%0D%0A * %0D%0A * Sample Input: %0D%0A * 2%0D%0A * acxz%0D%0A * bcxz%0D%0A * %0D%0A * Sample Output: %0D%0A * Funny%0D%0A * Not Funny%0D%0A */%0D%0Apublic class LookAtEverythingWeLearned %7B%0D%0A%0D%0A    public static void main(String%5B%5D args) %7B%0D%0A        Scanner sc = new Scanner(System.in);%0D%0A        %0D%0A        int numCases = sc.nextInt();%0D%0A        %0D%0A        for (int i = 0; i %3C numCases; i++) %7B%0D%0A            String input = sc.next();%0D%0A            if (isFunny(input)) %7B%0D%0A                System.out.println(%22Funny%22);%0D%0A            %7D else %7B%0D%0A                System.out.println(%22Not Funny%22);%0D%0A            %7D%0D%0A        %7D%0D%0A        sc.close();%0D%0A    %7D%0D%0A    %0D%0A    private static boolean isFunny(String str) %7B%0D%0A        %0D%0A        boolean funny = true;%0D%0A        %0D%0A        int fwdIndex = 1;%0D%0A        int bwdIndex = str.length() - 1;%0D%0A        int fwdCharVal;%0D%0A        int bwdCharVal;%0D%0A        %0D%0A        while (fwdIndex %3C str.length()) %7B%0D%0A            fwdCharVal = Math.abs(str.charAt(fwdIndex) - str.charAt(fwdIndex - 1));%0D%0A            bwdCharVal = Math.abs(str.charAt(bwdIndex - 1) - str.charAt(bwdIndex));%0D%0A            if (fwdCharVal != bwdCharVal) %7B%0D%0A                funny = false;%0D%0A                break;%0D%0A            %7D%0D%0A            fwdIndex++;%0D%0A            bwdIndex--;%0D%0A        %7D%0D%0A        %0D%0A        return funny;%0D%0A    %7D%0D%0A%7D

Add LookAtEverythingWeLearned