public class Solution {
/**
*
* @param x int整型
* @return bool布尔型
*/
public boolean isPalindrome (int x) {
if(x < 0){
return false;
}
// write code here
char[] data = String.valueOf(x).toCharArray();
int left = 0;
int right = data.length - 1;
while(left < right){
if(data[left] == data[right]){
left ++;
right --;
}else{
return false;
}
}
return true;
}
}