Skip to content

Commit

Permalink
Init + day 1 (2/2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck Grenier committed Dec 2, 2022
0 parents commit 39a646c
Show file tree
Hide file tree
Showing 5 changed files with 4,519 additions and 0 deletions.
14 changes: 14 additions & 0 deletions 1/1/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

$input = explode(PHP_EOL, file_get_contents('./input.txt'));
$elf = 0;
foreach ($input as $calories) {
if ($calories === '') {
$elf++;
}
$elves[$elf] = (int) $calories + (int) ($elves[$elf] ?? 0);
}

print(max($elves));


Loading

0 comments on commit 39a646c

Please sign in to comment.