#3504

Longest Palindrome After Substring Concatenation II

grandmaster · 2245 · lc hard +32 · 17.7% accepted · 90 likes · top 1%

Description

Strings s and t are given. Combine a (possibly empty) substring of s with a (possibly empty) substring of t by appending one after the other.

Find and return the length of the longest palindrome achievable from such a concatenation.

Code

1
2
3