You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
advent-of-code/ruby/day_20.rb

17 lines
212 B

houses = Hash.new(0)
elf = 0
while true
elf += 1
50.times do |i|
house = (i+1)*elf
houses[house] += 11*elf
if i.zero? && houses[house] >= 36000000
puts house
exit
end
end
end