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