Skip to content

Commit

Permalink
format algorithm/1.md
Browse files Browse the repository at this point in the history
  • Loading branch information
王艺 committed Apr 18, 2024
1 parent e8ddfb4 commit b3b51a3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/zh/posts/algorithm/1.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ func connect(root *Node) *Node {

![](https://pic.leetcode-cn.com/1626667201-NCWmuP-image.png)

**输入:** mat =** ** [[0,0,0],[0,1,0],[0,0,0]]
**输入:** mat = [[0,0,0],[0,1,0],[0,0,0]]
**输出:** [[0,0,0],[0,1,0],[0,0,0]]

**示例 2:**
Expand Down Expand Up @@ -368,7 +368,12 @@ func updateMatrix(matrix [][]int) [][]int {
}
}
}
direction := [][]int{{0, 1}, {0, -1}, {1, 0}, {-1, 0}}
direction := [][]int{
{0, 1},
{0, -1},
{1, 0},
{-1, 0}
}

for len(queue) > 0 { // 这里就是 BFS 模板操作了。
point := queue[0]
Expand Down

0 comments on commit b3b51a3

Please sign in to comment.