Determine whether an integer is a palindrome. Do this without extra space.
class Solution:
# @return a boolean
def isPalindrome(self, x):
i = 0
k = 0
temp1= x
temp2= x
if x < 0:
return False
while(temp1):
temp1 = temp1 / 10
i = i+1
while(i):
k = k+ temp2%10 * 10**(i-1)
temp2 = temp2/10
i = i-1
if k == x:
return True
else:
return False