Longest Common Subsequence
View as PDFSolve the Longest Common Subsequence problem.
Input Specification
Line 1:
Line 2: nonnegative integers
, the first sequence.
Line 3: nonnegative integers
, the second sequence.
Output Specification
Line 1: The length of the LCS of the first and second sequences.
Sample Input
5 3
1 4 3 4 2
2 1 3
Sample Output
2
Comments
Can anyone explain the input? I am confused.
The first line is
and 
The seccond line is
numbers aka your first sequence/array
The third line is
numbers aka your seccond sequence/array
You are trying to find the Longest Common Subsequence
This comment is hidden due to too much negative feedback. Show it anyway.
The test case can have multiple digit numbers you know
print(input())gives9 1 1 0 2 3 10 3 0not
9 1 1 0 2 3 1 0 3 0