Skip to content
Snippets Groups Projects
Commit 30b520a5 authored by Mactavish's avatar Mactavish
Browse files

add solution to hamming

parent 1e5e6c95
No related branches found
No related tags found
No related merge requests found
#include "hamming.h" #include "hamming.h"
#include <string.h>
int compute(const char *lhs, const char *rhs) { int compute(const char *lhs, const char *rhs) {
// TODO: implement this fucntion int count = 0;
if (strlen(lhs) != strlen(rhs)) {
return -1;
}
while (*lhs != '\0') {
if (*lhs != *rhs) {
count++;
}
lhs++;
rhs++;
}
return count;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment