Piotr Czajkowski 1 år sedan
förälder
incheckning
99130f146f
1 ändrade filer med 3 tillägg och 2 borttagningar
  1. 3 2
      23/code.go

+ 3 - 2
23/code.go

@@ -134,8 +134,9 @@ func calculate(board [][]byte) int {
 			break
 		}
 
-		current := frontier[0]
-		frontier = frontier[1:]
+		last := len(frontier) - 1
+		current := frontier[last]
+		frontier = frontier[:last]
 
 		if current.x == goal.x && current.y == goal.y {
 			if max < current.steps {