```
class Solution {
public boolean isPalindrome(int x) {
if(x < 0)
return false;
int l = 0;
int y = x;
while(y != 0){
y = y / 10;
l++;
}
while(l > 1){
int digit = (int) Math.pow(10, l-1);
int high = x / digit;
x -= high * digit;
int low = x % 10;
x = x /10;
if(high != low)
return false;
l = l - 2;
}
return true;
}
}
```