Solution for Hamming Distance.