Skip to content

Commit a655d95

Browse files
committed
Fix goreport bug
1 parent dff1d84 commit a655d95

File tree

8 files changed

+30
-29
lines changed

8 files changed

+30
-29
lines changed

leetcode/0116.Populating-Next-Right-Pointers-in-Each-Node/116.Populating Next Right Pointers in Each Node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type Node struct {
77
Next *Node
88
}
99

10-
//解法一:迭代
10+
// 解法一:迭代
1111
func connect(root *Node) *Node {
1212
if root == nil {
1313
return root

leetcode/0116.Populating-Next-Right-Pointers-in-Each-Node/116.Populating Next Right Pointers in Each Node_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type ans116 struct {
2222
one *Node
2323
}
2424

25-
func newQuestionNode()*Node{
25+
func newQuestionNode() *Node {
2626
node7 := &Node{}
2727
node7.Val = 7
2828

@@ -55,7 +55,7 @@ func newQuestionNode()*Node{
5555
return node1
5656
}
5757

58-
func newResultNode()*Node{
58+
func newResultNode() *Node {
5959
node7 := &Node{}
6060
node7.Val = 7
6161

@@ -114,4 +114,4 @@ func Test_Problem116(t *testing.T) {
114114
fmt.Printf("【output】:%v \n", connect(p.one))
115115
}
116116
fmt.Printf("\n\n\n")
117-
}
117+
}

leetcode/0306.Additive-Number/306. Additive Number.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func max(a int, b int) int {
3535
return b
3636
}
3737

38-
//Propagate for rest of the string
38+
// Propagate for rest of the string
3939
func recursiveCheck(num string, x1 int, x2 int, left int) bool {
4040
if left == len(num) {
4141
return true

leetcode/0372.Super-Pow/372. Super Pow.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ package leetcode
88
// 模运算性质五:ab % p = ((a % p) * ( b % p)) % p, 其中 ab 是一个数字,如:2874,98374 等等
99
// 举个例子
1010
// 12345^678 % 1337 = (12345^670 * 12345^8) % 1337
11-
// = ((12345^670 % 1337) * (12345^8 % 1337)) % 1337 ---> 利用性质 三
11+
//
12+
// = ((12345^670 % 1337) * (12345^8 % 1337)) % 1337 ---> 利用性质 三
1213
// = (((12345^67)^10 % 1337) * (12345^8 % 1337)) % 1337 ---> 乘方性质
13-
// = ((12345^67 % 1337)^10) % 1337 * (12345^8 % 1337)) % 1337 ---> 利用性质 四
14-
// = (((12345^67 % 1337)^10) * (12345^8 % 1337)) % 1337 ---> 反向利用性质 三
14+
// = ((12345^67 % 1337)^10) % 1337 * (12345^8 % 1337)) % 1337 ---> 利用性质 四
15+
// = (((12345^67 % 1337)^10) * (12345^8 % 1337)) % 1337 ---> 反向利用性质 三
1516
func superPow(a int, b []int) int {
1617
res := 1
1718
for i := 0; i < len(b); i++ {

leetcode/0401.Binary-Watch/401. Binary Watch.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ func readBinaryWatch1(num int) []string {
7676
return res
7777
}
7878

79-
/// ---------------------------------------
80-
/// ---------------------------------------
81-
/// ---------------------------------------
82-
/// ---------------------------------------
83-
/// ---------------------------------------
79+
// / ---------------------------------------
80+
// / ---------------------------------------
81+
// / ---------------------------------------
82+
// / ---------------------------------------
83+
// / ---------------------------------------
8484
// 以下是打表用到的函数
8585
// 调用 findReadBinaryWatchMinute(num, 0, c, &res) 打表
8686
func findReadBinaryWatchMinute(target, index int, c []int, res *[]string) {

leetcode/0509.Fibonacci-Number/509. Fibonacci Number.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,19 @@ func fib5(N int) int {
111111

112112
// 解法七 协程版,但是时间特别慢,不推荐,放在这里只是告诉大家,写 LeetCode 算法题的时候,启动 goroutine 特别慢
113113
func fib6(N int) int {
114-
return <-fibb(N)
114+
return <-fibb(N)
115115
}
116116

117-
func fibb(n int) <- chan int {
118-
result := make(chan int)
119-
go func() {
120-
defer close(result)
121-
122-
if n <= 1 {
123-
result <- n
124-
return
125-
}
126-
result <- <-fibb(n-1) + <-fibb(n-2)
127-
}()
128-
return result
129-
}
117+
func fibb(n int) <-chan int {
118+
result := make(chan int)
119+
go func() {
120+
defer close(result)
121+
122+
if n <= 1 {
123+
result <- n
124+
return
125+
}
126+
result <- <-fibb(n-1) + <-fibb(n-2)
127+
}()
128+
return result
129+
}

leetcode/0589.N-ary-Tree-Preorder-Traversal/589. N-ary Tree Preorder Traversal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package leetcode
22

3-
// Definition for a Node.
3+
// Definition for a Node.
44
type Node struct {
55
Val int
66
Children []*Node

leetcode/0648.Replace-Words/648. Replace Words.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func findWord(roots map[byte][]string, word []byte) bool {
3434
return false
3535
}
3636

37-
//解法二 Trie
37+
// 解法二 Trie
3838
func replaceWords1(dict []string, sentence string) string {
3939
trie := Constructor208()
4040
for _, v := range dict {

0 commit comments

Comments
 (0)