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

3 lines
164 B

p ARGF.read.split("\n").map(&:to_i).each_cons(2).count {|x,y| x < y }
p ARGF.read.split("\n").map(&:to_i).each_cons(3).map(&:sum).each_cons(2).count {|x,y| x < y }