feat: solve part two by overriding wire b and re-evaluating circuit
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package dayseven
|
package dayseven
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"maps"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -68,5 +69,9 @@ func PartOne(instructions map[string]string) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func PartTwo(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))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user