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.139 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.138 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.137 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.136 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.135 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.134 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.133 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.132 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.131 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.130 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.129 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.128 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.127 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.126 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.125 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.124 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.123 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.122 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.121 tracks/groovy/exercises/hamming/Example.groovy
trackler-2.2.1.120 tracks/groovy/exercises/hamming/Example.groovy