For equal-length sequences, the Hamming distance counts the columns that differ.
highlighted = computed this step
Count the columns that differ
When two sequences have the SAME length, the Hamming distance is just the number of positions where they disagree. Here 2 columns differ.
dH=2
Hamming needs equal lengths
Hamming distance cannot compare sequences of different lengths: it has no way to express an insertion or deletion, only a substitution in a fixed column. A single inserted base would shift every later column and inflate the count. The next lesson fixes this with edit distance.