class Solution {
public:
bool isPalindrome(int x) {
if(x < 0) {
return false;
}
int m = x;
int y = 0;
while(m) {
y = y * 10 + m % 10;
m /= 10;
}
return x == y;
}
};