Hamming Distance (Point Mutation Counting)

Foundational Mutations Distance Metrics
Significance:
The Hamming distance between two equal-length sequences is the simplest possible model of point mutations (SNPs) — the same idea underlying variant calling pipelines that compare a patient's read to a reference genome. It also underlies barcode/UMI error-correction schemes used in Illumina sequencing.
Statement

Given two DNA strings of equal length, count the number of positions at which the corresponding symbols differ.

Sample Input
GAGCCTACTAACGGGAT
CATCGTAATGACGGCCT
Sample Output
7
Constraints

- `1 ≤ length ≤ 1000` for both strings
- Both strings are guaranteed to have the **same length**


My Notes
Log in to save personal notes.
Console output will appear here when you click Run Code or Submit...
Enter DNA / RNA / Protein test string
Next Problem
Finding a Motif in DNA (Exact Matching)