public class Solution {

public boolean isPalindrome(int x) {

int a = x;

int n = 1;

```
if(a<0) return false;
while(a/n>=10){
n = n*10;
}
while(a>0){
if((a/n) != (a%10)) return false;
a = a%n;
if(a<10) return true;
a = a/10;
n = n/100;
}
return true;
}
```

}