Problem 3504 · Hard

Longest Palindrome After Substring Concatenation II

Take a substring of s, which may be empty, and glue a substring of t, which may also be empty, onto its end. Find the greatest length a palindrome built this way can have.

Open the interactive visualisation