input: Write a function to find the longest palindromic substring in a given string.
  assert longestPalSubstr("babad") == "bab" or longestPalSubstr("babad") == "aba"
  assert longestPalSubstr("cbbd") == "bb"
  assert longestPalSubstr("a") == "a"
  assert longestPalSubstr("ac") == "a" or longestPalSubstr("ac") == "c"
output: def longestPalSubstr(s):
      if len(s) == 0:
          return ""
      
      start = 0
      max_length = 1
  
      for i in range(1, len(s)):
          low = i - 1
          high = i
          
          while low >= 0 and high < len(s) and s[low] == s[high]:
              if high - low + 1 > max_length:
                  start = low
                  max_length = high - low + 1
              low -= 1
              high += 1
  
          low = i - 1
          high = i + 1
          while low >= 0 and high < len(s) and s[low] == s[high]:
              if high - low + 1 > max_length:
                  start = low
                  max_length = high - low + 1
              low -= 1
              high += 1
  
      return s[start:start + max_length]