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

Version Path
trackler-2.1.0.15 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.14 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.13 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.12 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.11 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.10 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.9 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.8 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.7 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.6 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.5 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.4 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.3 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.2 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.1 tracks/c/exercises/hamming/src/example.c
trackler-2.1.0.0 tracks/c/exercises/hamming/src/example.c
trackler-2.0.8.55 tracks/c/exercises/hamming/src/example.c
trackler-2.0.8.54 tracks/c/exercises/hamming/src/example.c
trackler-2.0.8.53 tracks/c/exercises/hamming/src/example.c
trackler-2.0.8.52 tracks/c/exercises/hamming/src/example.c