Determine palindrome in constant space