Piotr Czajkowski 1 年之前
父节点
当前提交
99130f146f
共有 1 个文件被更改,包括 3 次插入2 次删除
  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 {