Skip to content

Commit c9dcb46

Browse files
committed
add: leetcode 0997 test
1 parent f4aa4ac commit c9dcb46

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package leetcode
2+
3+
import (
4+
"fmt"
5+
"testing"
6+
)
7+
8+
type question997 struct {
9+
para997
10+
ans997
11+
}
12+
13+
// para 是参数
14+
type para997 struct {
15+
n int
16+
trust [][]int
17+
}
18+
19+
// ans 是答案
20+
type ans997 struct {
21+
ans int
22+
}
23+
24+
func Test_Problem997(t *testing.T) {
25+
26+
qs := []question997{
27+
28+
{
29+
para997{2, [][]int{{1, 2}}},
30+
ans997{2},
31+
},
32+
33+
{
34+
para997{3, [][]int{{1, 3}, {2, 3}}},
35+
ans997{3},
36+
},
37+
38+
{
39+
para997{3, [][]int{{1, 3}, {2, 3}, {3, 1}}},
40+
ans997{-1},
41+
},
42+
}
43+
44+
fmt.Printf("------------------------Leetcode Problem 997------------------------\n")
45+
46+
for _, q := range qs {
47+
_, p := q.ans997, q.para997
48+
fmt.Printf("【input】:%v 【output】:%v\n", p, findJudge(p.n, p.trust))
49+
}
50+
fmt.Printf("\n\n\n")
51+
}

0 commit comments

Comments
 (0)