improve LongestPalindromeSubstring