Sha256: 62a0836d89681b977ef88f7edcf7524d9b1bb094692ec3bc228c31bd1eb51456
Contents?: true
Size: 347 Bytes
Versions: 251
Compression:
Stored size: 347 Bytes
Contents
#include <stddef.h> #include <string.h> #include "hamming.h" size_t compute(const char *lhs, const char *rhs) { size_t lhs_len = strlen(lhs); size_t rhs_len = strlen(rhs); size_t count = 0; size_t i = 0; for (i = 0; i < lhs_len && i < rhs_len; ++i) { if (lhs[i] != rhs[i]) { ++count; } } return count; }
Version data entries
251 entries across 251 versions & 1 rubygems