HAMM: Counting Point Mutations
Given two strings and of equal length, the Hamming distance between and , denoted , is the number of corresponding symbols that differ in and . See Figure 2.
Given: Two DNA strings and of equal length (not exceeding 1 kbp).
Return: The Hamming distance .
library(readr) library(magrittr) f <- "hamm.txt" dna <- read_csv(f, col_names = FALSE)$X1 %>% strsplit(split = NULL) sum(dna[] != dna[]) %>% cat()