code: def longest_common_subsequence(s_1, s_2):
      """
      :param s1: string
      :param s2: string
      :return: int
      """
      m = len(s_1)
      n = len(s_2)
  
      mat = [[0] * (n + 1) for i in range(m + 1)]
      # mat[i][j] : contains length of LCS of s_1[0..i-1] and s_2[0..j-1]
  
      for i in range(m + 1):
          for j in range(n + 1):
              if i == 0 or j == 0:
                  mat[i][j] = 0
              elif s_1[i - 1] == s_2[j - 1]:
                  mat[i][j] = mat[i - 1][j - 1] + 1
              else:
                  mat[i][j] = max(mat[i - 1][j], mat[i][j - 1])
  
      return mat[m][n]
  
label_desc: Use image node_id 1 for calling a global function with example usage: longest_common_subsequence(s_1, s_2) and returns: mat