O(1) space longest palindrome