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/2020/ruby/day_01.rb

4 lines
95 B

n = 3
x = ARGF.read.split.map(&:to_i).combination(n).find {|x| x.sum == 2020 }
p x.reduce(&:*)