day9,10,11
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user