Sha256: f671fa87d2685085fce9964c2934ee4b276fb3f1619f7a4a89483a68c4ee93cd

Contents?: true

Size: 215 Bytes

Versions: 396

Compression:

Stored size: 215 Bytes

Contents

class DNA
  attr_reader :strand
  def initialize(strand)
    @strand = strand
  end

  def hamming_distance(other_strand)
    strand.chars.zip(other_strand.chars).count do |a, b|
      b && a != b
    end
  end
end

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.179 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.178 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.177 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.176 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.175 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.174 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.173 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.172 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.171 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.170 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.169 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.167 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.166 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.165 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.164 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.163 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.162 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.161 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb
trackler-2.2.1.160 tracks/ruby/exercises/point-mutations/.meta/solutions/point_mutations.rb