Problem:

Please find the problem here.

Solution:

This is just calculating the pairwise hamming distance as required.

Code: