This commit is contained in:
2020-12-01 11:45:43 +01:00
commit c24ac8ed4f
4 changed files with 226 additions and 0 deletions

15
day_01/second.rb Normal file
View File

@ -0,0 +1,15 @@
# frozen_string_literal: true
input = File.read('./input').lines.map(&:to_i)
input.each do |i|
input.each do |j|
next if i + j > 2020
rem = 2020 - i - j
if input.include? rem
puts i * j * rem
return
end
end
end