class Solution {
public boolean isPalindrome(int x) {
if(x < 0) return false;
int copy_x = x, result = 0;
while(copy_x != 0){
result = result*10 + copy_x%10;
copy_x = copy_x/10;
}
return x == result;
}
}