python海明距离 - 5IVI4I_I_60Y的日志 - 网易博客
时间:2014-06-11 22:00:49
收藏:0
阅读:521
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的日志 - 网易博客,布布扣,bubuko.com
原文:http://www.cnblogs.com/lexus/p/3772389.html
评论(0)