Longest Common Subsequence & the Survival Score
In short: the longest common subsequence (LCS) of two sequences is the
longest list of items that appear in both, in the same order, but not
necessarily side by side. A two-dimensional table, table[i][j] = the LCS
length of the first i items of a and the first j items of b, fills by
comparing the last item of each prefix: a match extends the diagonal by one, a
miss carries the larger of the cell above or to the left. The bottom-right
cell is the answer, and the diagonal steps taken to get there spell out the
subsequence itself.

Quarry keeps every revision of every document. When someone opens the history panel, the first question is simple: how much of the old version survived into the new one? A new paragraph in the middle shouldn't count as "everything after it changed", and a moved sentence shouldn't count as nothing changed. The measure that gets this right is the longest common subsequence (LCS): the longest list of lines that appear in both versions in the same order, not necessarily side by side.
This lesson fills the first real two-dimensional DP table in the course. Every diff you have ever read came out of a table like this one.
Why position-by-position fails
The obvious comparison lines the two versions up by index:
old = ["title", "intro", "body", "outro"]
new = ["title", "note", "intro", "body", "outro"]
same = sum(1 for a, b in zip(old, new) if a == b)
print(same)A subsequence ignores position and keeps order. title, intro, body, outro
appears in both lists in that order, so the survival count should be 4.