Longest palindrome

Given a string s, please compute the longest sufix of s that is a
palindrome, that is, that reads the same backward as forward.

Input

Input consists of several s, each one made up of between 1 and 10⁶
lowercase letters.

Output

For every s, print the length of the longest sufix of s that is a
palindrome.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T10:40:41.868Z

© Jutge.org, 2006–2026.
https://jutge.org
