Created
January 20, 2017 19:58
-
-
Save dreamer/0f05408791add1e5147a76bfa0b7d79c to your computer and use it in GitHub Desktop.
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.util.*; | |
public class Solution { | |
static String spr(String a) { | |
int n = a.length(); | |
for (int i = 0; i < n/2; ++i) { | |
if (a.charAt(i) != a.charAt(n-1-i)) | |
return "No"; | |
} | |
return "Yes"; | |
} | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
String s = sc.next(); | |
System.out.println(spr(s)); | |
sc.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment