✨ Finit les part 1 du jour 2 et 3
Ouin, pas le temps de faire les part 2 😭
This commit is contained in:
8
day_3/part_1.php
Normal file
8
day_3/part_1.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
$instruction = file_get_contents(__DIR__.'/input.txt');
|
||||
|
||||
preg_match_all('/mul\((\d+),(\d+)\)/', $instruction, $muls, PREG_SET_ORDER);
|
||||
|
||||
echo array_sum(array_map(static fn($mul) => $mul[1]*$mul[2], $muls));
|
||||
exit;
|
Reference in New Issue
Block a user