repl.it
@marksiemers1/HammingLeapYear
Ruby

No description

main.rb
module Year
  def self.leap?(year)
    year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)
  end
end

module Hamming
  def self.distance(a,b)
    a.chars.zip(b.chars).count{|first, second| first != second }
  end
end

puts "Year.leap?"
puts "==============="
puts Year.leap?(1900)
puts Year.leap?(2000)
puts Year.leap?(2016)

puts "Hamming.distance"
puts "==============="
puts Hamming.distance("ACCAGGG", "ACTATGG")
puts Hamming.distance("A", "A")
puts Hamming.distance("GGACTGA", "GGACTGA")
puts Hamming.distance("A", "G")
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]