update longest palindromic substring solution