988 views
2 votes
2 votes

Consider two strings A="pqqrr" and B="pqprqrp",let x be the length of the longest sub-sequence between A and B and let y be the number of such common sub-sequences between A and B then 2x+4y= ?

A) 22          B) 20          C)18          D)24

The answer is B) i.e. x=4 and y=3. I have understood how x is equal to 4. But what are the common sub-sequences? I am getting two i.e. "pqqr" and "pqrr". Here I have one doubt. Do i have to count twice for "pqqr" in A? Once for "pqqrr" and another one for "pqqrr".

Please log in or register to answer this question.

Related questions

0 votes
0 votes
1 answer
3
2 votes
2 votes
2 answers
4
Pooja Palod asked Dec 1, 2015
9,327 views
For X= BDCABA and Y=ABCBDAB find length of lcs and no of such lcs..(solve it using table method)