dylanhawley / hamming-distance

For two strings of fixed length n, the Hamming distance is the number of positions at which the corresponding symbol is different

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hamming Distance

The Hamming distance is a metric do determine the number of differences between two strings. For binary strings, it is calculated as the XOR of the two.

Examples

The Hamming distance between:

  • "karolin" and "kathrin" is 3.
  • "karolin" and "kerstin" is 3.
  • 1011101 and 1001001 is 2.
  • 2173896 and 2233796 is 3.

About

For two strings of fixed length n, the Hamming distance is the number of positions at which the corresponding symbol is different


Languages

Language:C++ 100.0%