@@ -0,0 +1,972 @@
+package java_problems.strings;%0D%0A%0D%0Aimport java.util.*;%0D%0A%0D%0A/*%0D%0A * Given a string A, print %22Yes%22 if it is a palindrome, print %22No%22 otherwise.%0D%0A * The strings will consist lower case english letters only. The strings will%0D%0A * have at most 50 characters.%0D%0A * %0D%0A * Some examples of palindromes are %22madam%22, %22anna%22, %22reviver%22.%0D%0A * %0D%0A * Sample Input:%0D%0A * madam%0D%0A * %0D%0A * Sample Output:%0D%0A * Yes%0D%0A */%0D%0Apublic class Reverse %7B%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A        %0D%0A        Scanner sc=new Scanner(System.in);%0D%0A        String A=sc.next();%0D%0A        boolean isPalindrome = true;%0D%0A        %0D%0A        for (int i = 0; i %3C A.length() / 2; i++) %7B%0D%0A            if (A.charAt(i) != A.charAt(A.length() - 1 - i)) %7B%0D%0A                isPalindrome = false;%0D%0A                break;%0D%0A            %7D%0D%0A        %7D%0D%0A        %0D%0A        if (isPalindrome) %7B%0D%0A            System.out.println(%22Yes%22);%0D%0A        %7D else %7B%0D%0A            System.out.println(%22No%22);%0D%0A        %7D%0D%0A        sc.close();%0D%0A    %7D%0D%0A%7D

Add Reverse