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.98 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.97 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.96 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.95 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.94 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.93 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.92 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.91 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.90 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.89 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.88 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.87 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.86 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.85 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.84 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.83 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.82 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.81 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.80 tracks/scheme/exercises/hamming/example.scm
trackler-2.2.1.79 tracks/scheme/exercises/hamming/example.scm