Solution for Day 04
This commit is contained in:
10
day_04/first.rb
Normal file
10
day_04/first.rb
Normal file
@ -0,0 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
input = File.read('./input').split("\n\n")
|
||||
|
||||
required = %w[byr iyr eyr hgt hcl ecl pid]
|
||||
|
||||
out = input.map do |passport|
|
||||
required.count { |e| passport.include? e } == required.size
|
||||
end
|
||||
puts out.count(true)
|
Reference in New Issue
Block a user