Sha256: 6b772d1cbb7e54555cc3cbc248845092fefbf11f116391b8f415aac1664801a8

Contents?: true

Size: 186 Bytes

Versions: 63

Compression:

Stored size: 186 Bytes

Contents

class Error() {}

Integer|Error distance(String s1, String s2) {
    if (s1.size != s2.size) {
        return Error();
    }
    return zipPairs(s1, s2).count(([c1, c2]) => c1 != c2);
}

Version data entries

63 entries across 63 versions & 1 rubygems

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