Sha256: 256e07911faacc7b0545389b49c67e69cd2e08e0b0096af4e4db5af8a3baffba

Contents?: true

Size: 183 Bytes

Versions: 374

Compression:

Stored size: 183 Bytes

Contents

class Hamming {

    def compute(strand1, strand2) {
        (0..[strand1.size(), strand2.size()].min() - 1).step(1).count() {
          strand1[it] != strand2[it]
        }
    }

}

Version data entries

374 entries across 374 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.118 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.117 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.116 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.115 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.114 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.113 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.111 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.110 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.109 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.108 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.107 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.106 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.105 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.104 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.103 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.102 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.101 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.100 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.99 tracks/groovy/exercises/hamming/Example.groovy