input: from typing import List
  
  def longest_common_subsequence(str1: str, str2: str) -> int:
      """ Finds the length of the longest common subsequence between two given strings.
      >>> longest_common_subsequence("ABACEDF", "ABDCF")
      4
      >>> longest_common_subsequence("ABC", "XYZ")
      0
      """
      m = len(str1)
      n = len(str2)
      
      L = [[None]*(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 str1[i-1] == str2[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]
output:     
      m = len(str1)
      n = len(str2)
      
      L = [[None]*(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 str1[i-1] == str2[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]
  