Build a Palindrome

  • + 1 comment

    In order to solve this use 2 structures: 1) Palindromic Tree 2) Suffix Tree

    For every index in the first string find longest palindrome that starts at this index and longest common substring that ends at this index. Repeat this logic for the second string. Of course you need to reverse one of them in both steps. Remember that there can be multiple answers with the same length.