All Tracks Algorithms String Algorithms Basics of String Manipulation Problem

Palindromes
/

Basic Programming, Implementation, String

Problem
Editorial
Analytics

Everybody loves palindromes, but Artur doesn't.
He has a string S that consists of lowercase English letters ('a' - 'z'). Artur wants to find a substring T of S of the maximal length, so that T isn't a palindrome.

Input
The input contains a single line, containing string S. String S consists of lower case English letters.

Output
In a single line print the length of T

Constraints
1 ≤ |S| ≤ 100000

SAMPLE INPUT
aba
SAMPLE OUTPUT
2
Explanation

"aba" is a palindrome, but "ab" isn't.

Time Limit: 3.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB

Best Submission

Similar Problems

Contributors

This Problem was Asked in

Initializing Code Editor...
Notifications
View All Notifications

?