Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

hamming c++

int hamming(string a, string b) {
	int d = 0;
	for (int i = 0; i < k; i++) {
		if (a[i] != b[i]) d++;
	}
	return d;//hamming distance between 2 strings a and b
}
 
PREVIOUS NEXT
Tagged: #hamming
ADD COMMENT
Topic
Name
6+2 =