Please elaboarate the following lines of code
def lcs(X , Y):
# find the length of the strings
m = len(X)
n = len(Y)
l = [[None] * (n + 1) for i in xrange(m + 1)]
I would advise you to adopt ways to figure this out yourself.
edit1: First thing you do is print(l) and see whats up.
This is a pythonesque way of creating arrays:
l = [[None]*(n+1) for i in xrange(m+1)]
and it could be written
l = []
for i in xrange( m + 1 ):
l.append( [None]*(n+1) )
now its clearer right?
and then you could try to print( [None] * 3 ) to see what this does.
and since the comment says len of strings. then X and Y are strings.
then pass some strings to the function and see what comes out :)
lis?