update longest palindromic substring