def longest_palindrome(s): def expand_around_center(left, right): # 从中心向左右扩展,找到最长的回文子串 while left >= 0 and right < len(s) and s[left] == s[right]: left -= 1 right += 1 return s[left + 1:right] # 返回当前找到的回文子串 longest = "" fo...