longest palindromic substring: constant sapce