From d2defd64e6487bec0c1d644a3bb5a733b3bcd3df Mon Sep 17 00:00:00 2001 From: Stefan Harmuth Date: Tue, 26 Oct 2021 08:21:43 +0200 Subject: [PATCH] day23; commented some thoughts in p2 --- day23/day.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/day23/day.go b/day23/day.go index 52d9d85..e2004de 100644 --- a/day23/day.go +++ b/day23/day.go @@ -92,6 +92,12 @@ func Part2(puzzle tools.AoCPuzzle) interface{} { "d": 0, } + /* + This could be optimized by closely looking at the input and finding the "inc x" loops + and then replace them with multiplications. + Also the code seems to resemble a factorial implementation which could lead to finding + the solution without executing the code at all. Needs more analysis. + */ register = run(puzzle.GetInputArray(), register) return register["a"]