InterviewSolution
Saved Bookmarks
| 1. |
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 = ___.(A) 33(B) 23(C) 43(D) 34 |
|
Answer» Answer: (D) Explanation: //The LCS is of length 4. There are 3 LCS of length 4 “qprr”, “pqrr” and qpqr |
|