day23; commented some thoughts in p2

This commit is contained in:
Stefan Harmuth 2021-10-26 08:21:43 +02:00
parent 3ed3fb78f7
commit d2defd64e6

View File

@ -92,6 +92,12 @@ func Part2(puzzle tools.AoCPuzzle) interface{} {
"d": 0, "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) register = run(puzzle.GetInputArray(), register)
return register["a"] return register["a"]