🎉 Initialise le repo comme tous les ans

This commit is contained in:
2022-12-01 09:06:21 +01:00
commit 51aaf9af97
5 changed files with 50 additions and 0 deletions

11
day_1/part_2.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
$calories = array_map(
static fn($elf) => array_sum(explode("\n", $elf)),
explode("\n\n", file_get_contents('./input.txt'))
);
rsort($calories);
echo array_sum(array_slice($calories, 0, 3));