Longest Palindromic Substring

Problem Return the longest contiguous palindromic substring of s.

Input / Output

  • Input: string s. Output: the longest palindromic substring (any one if tied).

Constraints

  • |s| up to 1000.

Example

  • "babad" → "bab" or "aba"; "cbbd" → "bb".
asked …
LeaderboardSalaryAccount