Longest Palindromic String

0

0 votes
Medium
Problem

Given a string S, find the longest palindromic substring in the string S.

Input:
First and only line will contain string S.

Output:
Print the length of the longest palindrome substring in the first line. In the second line print the longest palindromic substring in S. If there is more than one palindromic substring with the maximum length, output the first one.

Constraints:
1N105
String S will only contain lower case English alphabet [az].

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?