code: def _dynamic(self, seq1, seq2):
          
          if numpy:
              lengths = numpy.zeros((len(seq1) + 1, len(seq2) + 1), dtype=numpy.int)
          else:
              lengths = [array('L', [0] * (len(seq2) + 1)) for _ in range(len(seq1) + 1)]
  
          # row 0 and column 0 are initialized to 0 already
          for i, char1 in enumerate(seq1):
              for j, char2 in enumerate(seq2):
                  if char1 == char2:
                      lengths[i + 1][j + 1] = lengths[i][j] + 1
                  else:
                      lengths[i + 1][j + 1] = max(lengths[i + 1][j], lengths[i][j + 1])
  
          # read the substring out from the matrix
          result = ''
          i, j = len(seq1), len(seq2)
          while i != 0 and j != 0:
              if lengths[i][j] == lengths[i - 1][j]:
                  i -= 1
              elif lengths[i][j] == lengths[i][j - 1]:
                  j -= 1
              else:
                  assert seq1[i - 1] == seq2[j - 1]
                  result = seq1[i - 1] + result
                  i -= 1
                  j -= 1
          return result
docs: https://github.com/chrislit/abydos/blob/master/abydos/distance/_lcsseq.py
          http://www.dis.uniroma1.it/~bonifaci/algo/LCSSEQ.py
          http://rosettacode.org/wiki/Longest_common_subsequence#Dynamic_Programming_8