Java String Reverse _ HackerRank Problem

 Java String Reverse:



Here is the Solution: 100%

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();
        String C="";
        /* Enter your code here. Print output to STDOUT. */
        int b = A.length();
        for(int i=b-1; i>=0; i--){
            C =C+A.charAt(i);
        }
        if(A.equalsIgnoreCase(C)){
            System.out.print("Yes");
        }
        else{
            System.out.print("No");
        }
        
    }
}
My HackerRank Dp: https://www.hackerrank.com/nirobaurnab

Post a Comment

Previous Post Next Post