Skip to content
UPEEC

Longest Palindromic Substring

Medium#strings#dynamic-programming· solved by 0 · time limit 2.0 s

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

Input

One string of lowercase letters.

Output

The length.

Constraints

1 to 2000 letters.

Sample 1

Input

babad

Output

3

Sample 2

Input

cbbd

Output

2

Sign in or join free to run and submit your solution.