From 7f59926a68c3ba6c873b603c32c62e4ad29b6e5a Mon Sep 17 00:00:00 2001 From: yut23 Date: Sat, 9 Dec 2023 22:46:30 -0500 Subject: [PATCH] 2023 day 8: handle case where the solution is during the first cycle --- 2023/src/day08.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2023/src/day08.cpp b/2023/src/day08.cpp index 0d6e0d6..882946a 100644 --- a/2023/src/day08.cpp +++ b/2023/src/day08.cpp @@ -56,7 +56,7 @@ long part_2_slow(const std::vector &cycles) { } else { diffs.push_back(base_cycle.length); } - long step = base_cycle.start; + long step = 0; std::size_t i = 0; long counter = 0; // while any of the cycles aren't at a finish node: