Determine whether an integer is a palindrome. Do this without extra space.
Subscribe to see which companies asked this question
public class Solution {
public boolean isPalindrome(int x) {
int y =0 ;int t = x;
if(x<0)return false;
while(t!=0){
y=10*y+t%10;
t/=10;
}
if(y==x)return true;else return false;
}
}