12 lines
209 B
PHP
12 lines
209 B
PHP
|
<?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));
|
||
|
|