Redirecting to
NADOS

Manacher's Algorithm

1. You are given one string s1.
2. You have to find the longest palindromic substring in s1.
3. Expected Complexity : O(n)
Input Format
one string s1
Output Format
Print the length of the longest palindrome substring in the first line. In the second line print the longest palindromic substring in s1. If there is more than one palindromic substring with the maximum length, output the first one.
Question Video
Constraints
1 <= length of the string <= 10^5
Sample Input
abadxd
Sample Output
3
aba


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name