From 9caee546f07f91831ad0bc1b633a9d373743d7cb Mon Sep 17 00:00:00 2001 From: Kharec Date: Mon, 1 Dec 2025 23:11:41 +0100 Subject: [PATCH] feat: solve part two by overriding wire b and re-evaluating circuit --- internal/2015/DaySeven/code.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/2015/DaySeven/code.go b/internal/2015/DaySeven/code.go index 29431cd..5f70723 100644 --- a/internal/2015/DaySeven/code.go +++ b/internal/2015/DaySeven/code.go @@ -1,6 +1,7 @@ package dayseven import ( + "maps" "os" "strconv" "strings" @@ -68,5 +69,9 @@ func PartOne(instructions map[string]string) int { } func PartTwo(instructions map[string]string) int { - return 0 + signalA := PartOne(instructions) + instructionsCopy := make(map[string]string, len(instructions)) + maps.Copy(instructionsCopy, instructions) + instructionsCopy["b"] = strconv.Itoa(signalA) + return int(evaluateWire("a", instructionsCopy)) }