Mental Model
Find the longest starting part that all words share. We compare letters from the start until a difference appears.
Analogy: Imagine several friends starting to sing the same song. The longest common prefix is the part of the song they all sing together before someone changes the words.
words: [flower, flow, flight]
indexes: 0 1 2 3 4
prefix: ↑ ↑
f l