Created
July 26, 2018 19:15
-
-
Save AbdullahMagat/7028f7ce6af024e6eab8ce4f4b732b46 to your computer and use it in GitHub Desktop.
Hackerrank Java String Reverse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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