From 694954465686ce114c034fa638078c8675fa7847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20N=C3=A9meth=20Cs=2E?= Date: Sat, 7 Dec 2024 18:09:39 +0100 Subject: [PATCH] Update README.md --- 2024/Day07/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/2024/Day07/README.md b/2024/Day07/README.md index 8f9c87af..08c7a16b 100644 --- a/2024/Day07/README.md +++ b/2024/Day07/README.md @@ -7,6 +7,8 @@ You ask how long it'll take; the engineers tell you that it only needs final cal Read the [full puzzle](https://adventofcode.com/2024/day/7). -It's time to pull out the recursion guns. I introduced a checker logic that go through the numbers in one line of input and tries all possible operators on the accumulated result to reach the target. +It's time to pull out the recursion guns. I introduced a checker logic that goes through the numbers in one line of input and tries all possible operators on the accumulated result to reach the target. -The common logic that parses the input and executes the checker was extracted into a single `Solve` function, but I found it more readable to have distinct checkers for the two parts of the problem. Everything runs in about a second, but since it's just a single line, I added an optimization in `Check2` to exit early when the accumulated result exceeds the target. +The common logic that parses the input and executes the checker was extracted into a single `Solve` function, but I found it more readable to have distinct checkers for the two parts of the problem. + +Everything runs in about a second, but since it's just a single line, I couldn't stand and added an optimization in `Check2` to exit early when the accumulated result exceeds the target.