Skip to content

Instantly share code, notes, and snippets.

@dreamer
Created January 20, 2017 19:58
Show Gist options
  • Save dreamer/0f05408791add1e5147a76bfa0b7d79c to your computer and use it in GitHub Desktop.
Save dreamer/0f05408791add1e5147a76bfa0b7d79c to your computer and use it in GitHub Desktop.
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