Sha256: 1a0ae32f03e4da6df2ee4a4145abef19506a8bb5e8dc334cba93d55816875674
Contents?: true
Size: 288 Bytes
Versions: 396
Compression:
Stored size: 288 Bytes
Contents
module BookKeeping VERSION = 3 end class Hamming def self.compute(strand1, strand2) strand1.length == strand2.length || fail(ArgumentError, 'The two strands must have the same length.') (0...strand1.length).count do |i| strand1[i] != strand2[i] end end end
Version data entries
396 entries across 396 versions & 1 rubygems