Sha256: e1d287ac7dbca689ad37d515fea284b7d9fc7fa11d031ff8073402a11a7c5a33

Contents?: true

Size: 189 Bytes

Versions: 396

Compression:

Stored size: 189 Bytes

Contents

import sequtils

proc isDifferent(pair: tuple[a, b: char]): bool = pair.a != pair.b

proc distance*(s1, s2: string): int =
  len(filter(zip(toSeq(s1.items), toSeq(s2.items)), isDifferent))

Version data entries

396 entries across 396 versions & 1 rubygems

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