advent_of_code_2022/day_1/part_1.php

9 lines
158 B
PHP

<?php
echo max(
array_map(
static fn($elf) => array_sum(explode("\n", $elf)),
explode("\n\n", file_get_contents('./input.txt'))
)
);