```
class Solution {
private:
long long int reverseInt(long long int x)
{
// x>0
long long result = 0;
while(x>0)
{
result = result*10 + x%10;
x = x/10;
}
return result;
}
public:
bool isPalindrome(int x) {
if(x<0)
return false;
else if(x==0)
return true;
else
{
long long int X = (long long int) x;
long long int rX = reverseInt(X);
return (X==rX);
}
}
};
```