Hamming Distance

The Hamming distance between two strings is the number of positions in which the two strings differ. The function, by definition, is symmetric and distance(s, t) ≤ max(s.length(), t.length()).

References

  • wikipedia
  • Richard Hamming, Error Detecting and Error Correcting Codes, Bell System Technical Journal 26(2), 1950, pp.147-160.