Skip to content

Commit 30871db

Browse files
committed
add: leetcode 0794 test
1 parent b4e77f1 commit 30871db

File tree

1 file changed

+55
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)