|
|
@@ -49,9 +49,9 @@ func part2(program []byte, distances map[byte]map[byte]int) int {
|
|
|
moves[program[i]]++
|
|
|
}
|
|
|
|
|
|
- for current != 0 {
|
|
|
+ for {
|
|
|
var next byte
|
|
|
- var max int
|
|
|
+ var maximum int
|
|
|
|
|
|
distancesFromCurrent := distances[current]
|
|
|
for j := range path {
|
|
|
@@ -59,8 +59,8 @@ func part2(program []byte, distances map[byte]map[byte]int) int {
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
- if distancesFromCurrent[path[j]] > max {
|
|
|
- max = distancesFromCurrent[path[j]]
|
|
|
+ if distancesFromCurrent[path[j]] > maximum {
|
|
|
+ maximum = distancesFromCurrent[path[j]]
|
|
|
next = path[j]
|
|
|
}
|
|
|
}
|