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_05.rb

7 lines
179 B

seats = ARGF.read.split("\n")
.map {|pass| pass.tr("FB", "01").tr("LR", "01") }
.map {|pass| pass.to_i(2) }
p seats.max # day 1
p (0b1000..).find {|id| !seats.include?(id) }