Calculating the Hamming distance between two strings [1]