Problem Description
Given two strings A and B. Find the longest common sequence ( A sequence which does not need to be contiguous), which is common in both the strings.
You need to return the length of such longest common subsequence.
1 <= |A|, |B| <= 1005
First argument is an string A.
Second argument is an string B.
Return the length of such longest common subsequence between string A and string B.
Input 1:
A = "abbcdgf" B = "bbadcgf"
Output 1:
5
Explanation 1:
The longest common subsequence is "bbcgf", which has a length of 5
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 question? Checkout Sample Codes for more details.