Palindromes
Practice
4.1 (33 votes)
Approved
Basic programming
Easy
Implementation
Open
String manipulation
Problem
90% Success 18412 Attempts 20 Points 3s Time Limit 256MB Memory 1024 KB Max Code

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

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
45 votes
Tags:
Ad-HocApprovedEasyImplementationOpen
Points:20
105 votes
Tags:
ApprovedBasic ProgrammingBrute-force searchEasyReady
Points:20
40 votes
Tags:
AlgorithmsArraysString ManipulationString manipulation