#C6095. Longest Palindromic Substring Length

    ID: 49817 Type: Default 1000ms 256MiB

Longest Palindromic Substring Length

Longest Palindromic Substring Length

Given a string s consisting of lowercase English letters, find the length of the longest palindromic substring in s.

A palindrome is a string that reads the same forward and backward. Formally, a string \( s \) is a palindrome if \( s = s^R \), where \( s^R \) is the reverse of \( s \).

Your task is to compute the length of the longest contiguous substring of s which is a palindrome.

inputFormat

The input consists of a single line containing the string s.

Note that the string may be empty.

outputFormat

Output a single integer representing the length of the longest palindromic substring in s.

## sample
babad
3