Longest Pallindromic Subsequence

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.

NOTE:

Your code will be run on multiple test cases (<=10). Try to come up with an optimised solution.

CONSTRAINTS

1 <= Length of A, B <= 10^3 + 5

EXAMPLE INPUT

A : "bebeeed"

EXAMPLE OUTPUT

4

EXPLANATION

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.
Start solving Longest Pallindromic Subsequence on Interview Code Editor
Hints
  • Hints are not available for this problem

Discussion


Loading...
Click here to start solving coding interview questions