input: Write a function to find the longest palindromic substring.
  assert longest_palindrome("babad") == "bab" or longest_palindrome("babad") == "aba"
  assert longest_palindrome("cbbd") == "bb"
  assert longest_palindrome("a") == "a"
  assert longest_palindrome("ac") == "a" or longest_palindrome("ac") == "c"
output: 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 = ""
      for i in range(len(s)):
          odd_palindrome = expand_around_center(i, i)
          even_palindrome = expand_around_center(i, i + 1)
          longest = max(longest, odd_palindrome, even_palindrome, key=len)
  
      return longest