input: Write a function to find the longest common subsequence of two given strings.
  assert lcs("AGGTAB", "GXTXAYB", len("AGGTAB"), len("GXTXAYB")) == 4
  assert lcs("ABCDGH", "AEDFHR", len("ABCDGH"), len("AEDFHR")) == 3
  assert lcs("ABC", "AC", len("ABC"), len("AC")) == 2
output: def lcs(X, Y, m, n):
      L = [[0 for j in range(n+1)] for i in range(m+1)]
  
      for i in range(m+1):
          for j in range(n+1):
              if i == 0 or j == 0:
                  L[i][j] = 0
              elif X[i-1] == Y[j-1]:
                  L[i][j] = L[i-1][j-1] + 1
              else:
                  L[i][j] = max(L[i-1][j], L[i][j-1])
  
      return L[m][n]