input: Write a function to find the longest palindromic substring.
  assert longestPalindromicSubstring("babad") == 3
  assert longestPalindromicSubstring("cbbd") == 2
  assert longestPalindromicSubstring("a") == 1
output: def longestPalindromicSubstring(s: str) -> int:
      def expand_around_center(left: int, right: int) -> int:
          while left >= 0 and right < len(s) and s[left] == s[right]:
              left -= 1
              right += 1
          return right - left - 1
      
      if not s:
          return 0
      
      max_len = 0
      for i in range(len(s)):
          len1 = expand_around_center(i, i)
          len2 = expand_around_center(i, i + 1)
          max_len = max(max_len, len1, len2)
      
      return max_len