Given a strings A. Find the common pallindromic sequence ( A sequence which does not need to be contiguous and is a pallindrome),
which is common in itself
You need to return the length of such longest common subsequence.
Your code will be run on multiple test cases (<=10). Try to come up with an optimised solution.
1 <= Length of A, B <= 10^3 + 5
A : "bebeeed"
The longest common pallindromic subsequence is "eeee", which has a length of 4
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.