@@ -0,0 +1,1158 @@
+import java.util.Scanner;%0Aclass LoveLetterMystery%7B%0A    static int reduceChar(char x,char y)%7B%0A        char c1=x,c2=y;%0A        int count=0;%0A        if(y%3Ex)%7B%0A            c1=y;%0A            c2=x;%0A        %7D%0A        while(c1%3Ec2)%7B%0A            //System.out.println(%22Reducing %22+c1);%0A            c1--;%0A            count++;%0A        %7D%0A        return count;%0A    %7D%0A    static int calculateOps(String s)%7B%0A       StringBuffer sb=new StringBuffer(s);%0A        String r=sb.reverse().toString();%0A       if(r.equals(s))%0A        %7B//System.out.println(r + %22and%22+ s+%22its palindrom already%22);%0A            return 0;%7D%0A        else%7B%0A            int p=0;%0A            char%5B%5D c=s.toCharArray();%0A            int l=s.length();%0A            int i=0,j=l-1;%0A            while(i%3Cl/2)%7B%0A                if(c%5Bi%5D!=c%5Bj%5D)p=p+reduceChar(c%5Bi%5D,c%5Bj%5D);%0A                i++;j--;%0A            %7D%0A            return p;%0A        %7D%0A    %7D%0A    public static void main(String args%5B%5D)%7B%0A        Scanner s=new Scanner(System.in);%0A        int t=s.nextInt();%0A        String empty=s.nextLine();%0A       for(int i=0;i%3Ct;i++)%7B%0A           String s1=s.nextLine();%0A           System.out.println(calculateOps(s1));%0A       %7D%0A    %7D%0A%7D%0A

Create LoveLetterMystery.java