Problem 7: Hamming Distance

Easy

The Hamming distance between two DNA strings is the number of positions at which the corresponding symbols are different. Given two DNA strings of equal length, calculate the Hamming distance between them.

Write a program to calculate the Hamming distance between the two DNA strings provided as input. Run your code with the provided input, and then paste your result here to submit.

Sample Input:

GAGCCTACTAACGGGAT GATCGGAATAGTGGTCT

Sample Output:

8

Constraints:

Both DNA strings will be of equal length, containing at most 1,000 nucleotides.

Explanation:

The two DNA strings in the sample input differ at 8 positions. Therefore, the Hamming distance is 8.

Post a Comment

0Comments

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our app uses cookies to enhance your experience. Check Now
Ok, Go it!