longest_palindromic_substring(s) that returns the longest contiguous substring of s that is a palindrome. If several substrings tie for the longest length, return the one that starts earliest in s.s = 'babad'
'bab'
'bab' and 'aba' are both length-3 palindromes; 'bab' starts earlier, so it wins the tie.
s = 'cbbd'
'bb'
'bb' is the longest palindromic substring.
Use expand-around-center for both odd and even length palindromes, from every position.
Track the best (start, end) span found so far, updating only on a strictly longer match to preserve the earliest tie.