advent_of_code_2020/day_4/part_2.php
2020-12-04 12:13:43 +01:00

13 lines
327 B
PHP

<?php
include 'passport.php';
$passports = explode("\n\n", file_get_contents('input.txt'));
$number_of_valid_passports = 0;
foreach ($passports as $passport) {
$passport_o = Passport::fromInput($passport);
$number_of_valid_passports += ($passport_o->isReallyValid()) ? 1 : 0;
}
var_dump($number_of_valid_passports);