day9,10,11

This commit is contained in:
2023-12-13 23:54:55 +00:00
parent 84e8207917
commit 3948cbaa8c
11 changed files with 1115 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
package day08
import (
_ "fmt"
"fmt"
_ "adventofcode2023/utils"
"regexp"
"strings"
@@ -22,6 +22,7 @@ func Part1(input string) int {
func Part2(input string) int {
instructions, nexts, network := parseInput2(input)
fmt.Println(nexts)
ans := 1
for _, next := range nexts {
ans = lcm(ans, getSteps(next, instructions, network, false))
@@ -91,6 +92,7 @@ func getSteps(next string, instructions []rune, network Network, partOne bool) i
}
} else {
if next[2] == 'Z' {
fmt.Println(next)
return steps
}
}