Instabase interview question
3287

You are given two string A and B. You need to find the length of the longest palindrome that can be formed using the characters from two palindromic substrings. such that one palindromic substring is obtained from string A and other is obtained from string B.

constraints

1<=|A| , |B| <=10^5

Input
Two string A and B

Output
The length of longest palindrome

Sample input
abba
xyyx

Sample output
8

Comments (5)