#include "hamming.h"
#include <string.h>

int compute(const char *lhs, const char *rhs) {
  size_t lhsLen = strlen(lhs);
  size_t rhsLen = strlen(rhs);

  if (lhsLen != rhsLen)
    return -1;

  if (lhsLen == 0 && rhsLen == 0)
    return 0;

  int count = 0;

  for (size_t i = 0; i < lhsLen; ++i) {
    if (lhs[i] != rhs[i])
      count++;
  }

  return count;
}