Dodomeki
Sign in

114. Longest Palindromic Substring

Hard

Given a string texto, return the length of the longest palindromic substring. A substring is a contiguous sequence of characters.

Example 1
Input: texto = "abacabae"
Output: 7
Explanation: "abacaba" is a palindrome and has length 7.
Example 2
Input: texto = "civicx"
Output: 5
Constraints
  • 0 <= texto.length <= 1000
Dynamic programmingStrings
Caso 1
texto =
"abacabae"
Expected =
7
Caso 2
texto =
"civicx"
Expected =
5

Run checks these 2 cases. Submit runs all 6, including hidden ones.