Longest Palindromic Substring
Examples
Example 1:
Input: s = "ababd"
Output: "bab"
Explanation:
Example 2:
Input: s = "abbc"
Output: "bb"
Example 1:
Input: s = "ababd"
Output: "bab"
Explanation:
Example 2:
Input: s = "abbc"
Output: "bb"
Given a string s, return the longest substring of s that is a palindrome.
A palindrome is a string that reads the same forward and backward.
If there are multiple palindromic substrings that have the same length, return any one of them.
Both "aba" and "bab" are valid answers.
1 <= s.length <= 1000s contains only digits and English letters.