Sha256: a66968bdafe607f023051c37ed28c933b54fd029eaa03e014967c1e4effc0539

Contents?: true

Size: 359 Bytes

Versions: 396

Compression:

Stored size: 359 Bytes

Contents

(define-module (hamming)
  #:export (hamming-distance))

(define hamming-distance
  (lambda (dna1 dna2)
    (if (eqv? (string-length dna1) (string-length dna2))
        (length
         (filter not
                 (map char=?
                      (string->list dna1)
                      (string->list dna2))))
        (error "String length mismatch."))))

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.179 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.178 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.177 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.176 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.175 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.174 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.173 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.172 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.171 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.170 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.169 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.167 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.166 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.165 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.164 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.163 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.162 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.161 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.160 tracks/scheme/exercises/hamming/example.scm