#C11670. Maximum Consecutive Palindromic Substrings
Maximum Consecutive Palindromic Substrings
Maximum Consecutive Palindromic Substrings
Given a string ( s ), each character is considered as a palindromic substring (since a single character reads the same forwards and backwards). Your task is to compute the maximum number of consecutive palindromic substrings in ( s ). For this specific problem, note that every character in ( s ) is inherently a palindromic substring, so the answer is simply the length of the string.
For example, if ( s = \texttt{'abacaba'} ), the output is 7 since there are 7 characters, and similarly for other cases.
inputFormat
A single line containing the string ( s ). The input should be read from standard input (stdin).
outputFormat
An integer representing the maximum number of consecutive palindromic substrings in ( s ), printed to standard output (stdout).## sample
abacaba
7
</p>