solve palindrome number without extra space