You are given a string s consisting of lowercase English letters.
A substring is almost-palindromic if it becomes a palindrome after removing exactly one character from it.
Return an integer denoting the length of the longest almost-palindromic substring in s.
Example 1:
Input: s = "abca"
Output: 4
Explanation:
Choose the substring "abca".
"abca"."aba", which is a palindrome."abca" is almost-palindromic.Example 2:
Input: s = "abba"
Output: 4
Explanation:
Choose the substring "abba".
"abba"."aba", which is a palindrome."abba" is almost-palindromic.Example 3:
Input: s = "zzabba"
Output: 5
Explanation:
Choose the substring "zzabba".
"zabba"."abba", which is a palindrome."zabba" is almost-palindromic.Constraints:
2 <= s.length <= 2500s consists of only lowercase English letters.Loading editor...
"abca"