update longest_palindromic_substring