human
Longest Common Subsequence | DP | Returns length of LCS for X [ 0. . m - 1 ] , Y [ 0. . n - 1 ].
Driver program to test the above function"
Solution in Python:
assistant
#Here is code to longest Common Subsequence and the other steps required.
 def lcs ( X , Y , m , n ) :
	if m == 0 or n == 0 :
	return 0 ;
	elif X [ m - 1 ] == Y [ n - 1 ] :
	return 1 + lcs ( X , Y , m - 1 , n - 1 ) ;
	else :
	return max ( lcs ( X , Y , m , n - 1 ) , lcs ( X , Y , m - 1 , n ) ) ;
X = " AGGTAB "
Y = " GXTXAYB "
print " Length ▁ of ▁ LCS ▁ is ▁ " , lcs ( X , Y , len ( X ) , len ( Y ) )