From f1899b06400e5c8834c7b49bd6a2dea8618ee41d Mon Sep 17 00:00:00 2001 From: Clement Desmidt Date: Tue, 7 Dec 2021 10:44:30 +0100 Subject: [PATCH] :sparkles: Finit le jour 7 --- day_7/part_1.php | 22 ++++++++++++++++++++++ day_7/part_2.php | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 day_7/part_1.php create mode 100644 day_7/part_2.php diff --git a/day_7/part_1.php b/day_7/part_1.php new file mode 100644 index 0000000..cfd9e53 --- /dev/null +++ b/day_7/part_1.php @@ -0,0 +1,22 @@ + $fuel_used) { + $lowest_fuel = $fuel_used; + $best_position = $i; + } +} + +echo sprintf('Best position is %u with %u fuel used.', $best_position, $lowest_fuel); \ No newline at end of file diff --git a/day_7/part_2.php b/day_7/part_2.php new file mode 100644 index 0000000..8dfdecd --- /dev/null +++ b/day_7/part_2.php @@ -0,0 +1,22 @@ + $fuel_used) { + $lowest_fuel = $fuel_used; + $best_position = $i; + } +} + +echo sprintf('Best position is %u with %u fuel used.', $best_position, $lowest_fuel); \ No newline at end of file