human
Count common subsequence in two strings | return the number of common subsequence in two strings.
for each character of S.
for each character in T.
if character are same in both the string.
Driver Code"
Solution in Python:
 ... Write me a code to count common subsequence in two strings and the other steps required?
assistant
#Here is code to count common subsequence in two strings and the other steps required.
 def CommomSubsequencesCount ( s , t ) :
	n1 = len ( s )
	n2 = len ( t )
	dp = [ [ 0 for i in range ( n2 + 1 ) ] for i in range ( n1 + 1 ) ]
	for i in range ( 1 , n1 + 1 ) :
		for j in range ( 1 , n2 + 1 ) :
			if ( s [ i - 1 ] == t [ j - 1 ] ) :
				dp [ i ] [ j ] = ( 1 + dp [ i ] [ j - 1 ] + dp [ i - 1 ] [ j ] )
			else :
				dp [ i ] [ j ] = ( dp [ i ] [ j - 1 ] + dp [ i - 1 ] [ j ] - dp [ i - 1 ] [ j - 1 ] )
	return dp [ n1 ] [ n2 ]
s = " ajblqcpdz "
t = " aefcnbtdi "
print ( CommomSubsequencesCount ( s , t ) )