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
Submissions
Please login to view your submissions
Similar Problems
Points:30
29 votes
Tags:
AlgorithmsApprovedImplementationMediumOpenTrees
Points:20
26 votes
Tags:
ApprovedBasic ProgrammingEasyImplementationOpenSorting
Points:20
40 votes
Tags:
AlgorithmsArraysString ManipulationString manipulation
Editorial