LogiQuest

33. Longest Palindromic Substring

MediumStringExpand Around Center

Print the length of the longest substring that is a palindrome.

Input format

A single string.

Output format

The length.

Example 1

Input

babad

Output

3

Example 2

Input

cbbd

Output

2

Constraints

1 ≤ length ≤ 1000

Read input from standard input and print the answer to standard output. Your code is judged against 6 test cases, most of them hidden.

Loading the MyLoginn IDE…