Skip to content

Commit beccf9f

Browse files
committed
更正路径
1 parent ef09a17 commit beccf9f

File tree

106 files changed

+302
-56
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+302
-56
lines changed

Algorithms/0055. Jump Game/55. Jump Game.go renamed to Algorithms/0055.Jump-Game/55. Jump Game.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ func canJump(nums []int) bool {
1717
}
1818
return true
1919
}
20+
21+
func max(a int, b int) int {
22+
if a > b {
23+
return a
24+
}
25+
return b
26+
}
File renamed without changes.

Algorithms/0337. House Robber III/337. House Robber III.go renamed to Algorithms/0337.House-Robber-III/337. House Robber III.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
package leetcode
22

3+
import (
4+
"github.com/halfrost/LeetCode-Go/structures"
5+
)
6+
7+
// TreeNode define
8+
type TreeNode = structures.TreeNode
9+
310
/**
411
* Definition for a binary tree node.
512
* type TreeNode struct {
@@ -25,3 +32,10 @@ func dfsTreeRob(root *TreeNode) (a, b int) {
2532
tmp1 := root.Val + l0 + r0
2633
return tmp0, tmp1
2734
}
35+
36+
func max(a int, b int) int {
37+
if a > b {
38+
return a
39+
}
40+
return b
41+
}

Algorithms/0337. House Robber III/337. House Robber III_test.go renamed to Algorithms/0337.House-Robber-III/337. House Robber III_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package leetcode
33
import (
44
"fmt"
55
"testing"
6+
7+
"github.com/halfrost/LeetCode-Go/structures"
68
)
79

810
type question337 struct {
@@ -27,7 +29,7 @@ func Test_Problem337(t *testing.T) {
2729
qs := []question337{
2830

2931
question337{
30-
para337{[]int{3, 2, 3, NULL, 3, NULL, 1}},
32+
para337{[]int{3, 2, 3, structures.NULL, 3, structures.NULL, 1}},
3133
ans337{7},
3234
},
3335

@@ -37,7 +39,7 @@ func Test_Problem337(t *testing.T) {
3739
},
3840

3941
question337{
40-
para337{[]int{3, 4, 5, 1, 3, NULL, 1}},
42+
para337{[]int{3, 4, 5, 1, 3, structures.NULL, 1}},
4143
ans337{9},
4244
},
4345
}
@@ -46,7 +48,7 @@ func Test_Problem337(t *testing.T) {
4648

4749
for _, q := range qs {
4850
_, p := q.ans337, q.para337
49-
fmt.Printf("【input】:%v 【output】:%v\n", p, rob337(Ints2TreeNode(p.one)))
51+
fmt.Printf("【input】:%v 【output】:%v\n", p, rob337(structures.Ints2TreeNode(p.one)))
5052
}
5153
fmt.Printf("\n\n\n")
5254
}
File renamed without changes.
File renamed without changes.

Algorithms/0529. Minesweeper/529. Minesweeper.go renamed to Algorithms/0529.Minesweeper/529. Minesweeper.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ func updateBoard(board [][]byte, click []int) [][]byte {
3939
return board
4040
}
4141

42+
func isInBoard(board [][]byte, x, y int) bool {
43+
return x >= 0 && x < len(board) && y >= 0 && y < len(board[0])
44+
}
45+
4246
func mineSweeper(x, y int, board [][]byte, mineMap [][]int, dir8 [][]int) {
4347
if board[x][y] != 'M' && board[x][y] != 'E' {
4448
return

0 commit comments

Comments
 (0)