Build the PrimitiveMedium
Longest Palindromic Substring
Write `longest_palindrome(s)` returning the longest palindromic substring. Any one will do if several tie.
longest_palindrome("babad") -> "bab" or "aba"
longest_palindrome("cbbd") -> "bb"
There are 2n-1 centres, not n: each character, and each gap between characters. Forgetting the even-length centres is the classic bug and it silently returns a shorter answer. The DP table version is O(n^2) space where expansion needs none.
What to expect: A timer starts when you begin. Edit the starter code, run it against the test suite as many times as you like, then finish when you're done. The reference solution and interviewer follow-up questions unlock only after you finish.