Idea is simple, just compare the first an last digit each time.

```
public boolean isPalindrome(int x) {
if(x < 0) return false;
int divisor = 1;
while( x/divisor >= 10) divisor *= 10;
while(divisor >= 10 && (x / divisor == x % 10)){
x = (x%divisor)/10;
divisor /= 100;
}
return divisor >= 10 ? false : true;
}
```