python海明距离 - 5IVI4I_I_60Y的日志 - 网易博客
def hammingDist(s1, s2):
assert len(s1) == len(s2)
return sum([ch1 != ch2 for ch1, ch2 in zip(s1, s2)])
python海明距离 - 5IVI4I_I_60Y的日志 - 网易博客
def hammingDist(s1, s2):
assert len(s1) == len(s2)
return sum([ch1 != ch2 for ch1, ch2 in zip(s1, s2)])