Write a function that returns the longest palindrome in a given string

You can find the the longest palindrome using Manacher’s Algorithm in O(n) time! Its implementation can be found here and here.

For input String s = "HYTBCABADEFGHABCDEDCBAGHTFYW1234567887654321ZWETYGDE" it finds the correct output which is 1234567887654321.

Leave a Comment