class Solution {
public:
bool isPalindrome(int x) {
if (x < 0 || x && x % 10 == 0) return false;
long long s = 0;
int y=x;
while (s <= x)
{
s = s * 10 + y % 10;
if (s == x ) return true;
y /= 10;
if(y==0)break;
}
return false;
}
};