Each cell [i,j] shows the minimum number of single‑character edits to transform the first j characters of the source into the first i characters of the target.
If characters match: use the diagonal value (no edit).
If they differ, take the minimum of:
Left + 1
(horizontal move, deletion)
Up + 1
(vertical move, insertion)
Diagonal + 1
(diagonal move, substitution)
Result