Back to library

Write a Python function that returns the longest palindromic substring of a string. Ex

Prompt

Write a Python function that returns the longest palindromic substring of a string. Explain the approach briefly, then give the code with type hints.

Open model Playground