Mental Model
Find the longest sequence of characters that appears exactly the same in both strings without skipping any characters.
Analogy: Imagine two sentences written on paper. The longest common substring is like the longest exact phrase that appears in both sentences side by side without any gaps.
String1: A B C D E F G String2: X Y B C D Z We look for the longest exact matching block: B -> C -> D ā ā match starts here