Mental Model
Find the longest sequence of characters that appears exactly the same in both strings without skipping any characters.
Analogy: Imagine two friends reading two different books and trying to find the longest exact phrase that appears in both books without any gaps.
String1: a b c d e f g h
String2: x y a b c z h i j
Matrix:
x y a b c z h i j
0 0 0 0 0 0 0 0 0 0
a 0 0 0 ↑1 0 0 0 0 0
b 0 0 0 0 ↑2 0 0 0 0
c 0 0 0 0 0 ↑3 0 0 0
...