Write a function that finds the longest palindromic substring of a given string. Try to be as efficient as possible!
If you find more than one substring, you should return the one that’s closer to the beginning.
Input: A text as a string.
Output: The longest palindromic substring.
longest_palindromic('abc') == 'a' longest_palindromic('abacada') == 'aba'
1 < |text| ≤ 20
The text contains only ASCII characters.