Solution for Day 04

This commit is contained in:
2020-12-04 09:56:47 +01:00
parent 5598936603
commit 52e88dc154
3 changed files with 1007 additions and 0 deletions

10
day_04/first.rb Normal file
View 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)