retagged by
16,905 views
45 votes
45 votes

Consider two strings $A$="qpqrr" and $B$="pqprqrp". Let $x$ be the length of the longest common subsequence (not necessarily contiguous) between $A$ and $B$ and let $y$ be the number of such longest common subsequences between $A$ and $B$. Then $x +10y=$ ___.

retagged by

7 Answers

2 votes
2 votes
common subsequences in A  and B are  qpqr , pqrr , qprr

so X=4 and Y=3

4 +10*3 =34
1 votes
1 votes
How to calculate the number of largest common subsequences..?
1 votes
1 votes

I got the answer while doing like this at the first attempt. Is this a valid method.

Answer:

Related questions

47 votes
47 votes
3 answers
2
go_editor asked Sep 28, 2014
13,634 views
The number of distinct minimum spanning trees for the weighted graph below is _____
27 votes
27 votes
5 answers
4
go_editor asked Sep 28, 2014
11,518 views
Consider the function func shown below: int func(int num) { int count = 0; while (num) { count++; num>>= 1; } return (count); }The value returned by func($435$) is ______...