#K69812. Hamming Distance Between DNA Strands
Hamming Distance Between DNA Strands
Hamming Distance Between DNA Strands
Given two DNA strands of equal length, your task is to compute the Hamming distance. The Hamming distance between two strings is defined as the number of positions at which the corresponding symbols differ.
For two DNA strands (s_1) and (s_2) of length (n), the Hamming distance is defined as:
[ \text{Hamming Distance} = \sum_{i=1}^{n} \mathbb{1}{{s{1,i} \neq s_{2,i}}} ]
The DNA strands consist only of the characters A, T, G, and C.
inputFormat
The input is given via standard input (stdin) and consists of two lines. The first line contains the first DNA strand and the second line contains the second DNA strand. It is guaranteed that both strands are of equal length.
outputFormat
Output a single integer to standard output (stdout) which represents the Hamming distance between the two DNA strands.## sample
AAAA
AAAA
0