advent_of_code_2020/day_6/part_1.php

12 lines
239 B
PHP
Raw Normal View History

2020-12-08 16:38:19 +01:00
<?php
$groups = explode("\n\n", file_get_contents('input.txt'));
$yesses = 0;
foreach ($groups as $group) {
$group_yes = implode('', explode("\n", $group));
$yesses += count(array_unique(str_split($group_yes)));
}
echo $yesses;