Skip to content

Instantly share code, notes, and snippets.

@AbdullahMagat
Created July 26, 2018 19:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbdullahMagat/7028f7ce6af024e6eab8ce4f4b732b46 to your computer and use it in GitHub Desktop.
Save AbdullahMagat/7028f7ce6af024e6eab8ce4f4b732b46 to your computer and use it in GitHub Desktop.
Hackerrank Java String Reverse
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 str="Yes";
for(int i=0; i<A.length()/2; i++){
if(A.charAt(i)!=A.charAt(A.length()-i-1)){
str="No";
}
}System.out.println(str);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment