Skip to main content

Posts

Showing posts with the label Java String Reverse Hackerrank Solution

Java String Reverse Hackerrank Solution

 Java String Reverse Hackerrank Solution For Explanation Watch Video: Sample Input madam Sample Output Yes Code: import  java.io.*; import  java.util.*; public   class  Solution {      public   static   void  main(String[] args) {                  Scanner sc= new  Scanner(System.in);         String A=sc.next();         StringBuilder sb =  new  StringBuilder(A);         String n = sb.reverse().toString();          if (A.equals(n)){             System.out.println( "Yes" );         } else {        ...