No.765 ukuku 2
Problem Statement
Define the 'Tapisa' of a string as the length of the longest palindrome contained in that string.
You are given a string $S$. When $1$ character in $S$ is deleted, find the maximum possible 'Tapisa' of the string.
Input
$S$
$S$ is a string consisting of lowercase letters and satisfies $2 \leq |S| \leq 2 \times 10^5$. ( $|S|$ is the length of the string $S$ )
Output
Print the answer on $1$ line. End the output with a newline.
Sample
Sample 1
Input
ukuku
Output
4
The length of the longest palindrome contained in the string "kuku", obtained by deleting character $1$, is $3$.
The length of the longest palindrome contained in the string "uuku", obtained by deleting character $2$, is $3$.
The length of the longest palindrome contained in the string "ukku", obtained by deleting character $3$, is $4$.
The length of the longest palindrome contained in the string "ukuu", obtained by deleting character $4$, is $3$.
The length of the longest palindrome contained in the string "ukuk", obtained by deleting character $5$, is $3$.
Therefore, the maximum 'Tapisa' of the string after deleting $1$ character is $4$.
Sample 2
Input
ukunichia
Output
3
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
treeone
ei1333333