Solve a problem in leetcode to determine if an integer is palindrome without using extra space.