dsa · medium
Longest Palindromic Substring
Return the longest palindromic **substring** of s. If several have the same length, return any one of them.
Arguments
s— the string whose longest palindromic substring is required
Example
"babad" → "bab" (or "aba").
"cbbd" → "bb".
Constraints
1 <= s.length <= 1000 s consists of digits and English letters Hidden tests include near-max size for this bound; a slower-than-intended solution TLEs.
Examples
Example 1
Input: "babad" Expected: bab
Example 2
Input: "cbbd" Expected: bb