advent_of_code_2019/day_1/part_1.php
2019-12-06 14:32:52 +01:00

9 lines
167 B
PHP

<?php
$masses = explode(',', file_get_contents('input.txt'));
echo array_sum(
array_map(function($mass) {
return floor($mass / 3) - 2;
}, $masses)
);