longest palindromic substring: constant space