Skip to content

Commit 2a5d87d

Browse files
committed
add: leetcode 0488 test
1 parent 255faef commit 2a5d87d

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package leetcode
2+
3+
import (
4+
"fmt"
5+
"testing"
6+
)
7+
8+
type question488 struct {
9+
para488
10+
ans488
11+
}
12+
13+
// para 是参数
14+
type para488 struct {
15+
board string
16+
hand string
17+
}
18+
19+
// ans 是答案
20+
type ans488 struct {
21+
ans int
22+
}
23+
24+
func Test_Problem488(t *testing.T) {
25+
26+
qs := []question488{
27+
28+
{
29+
para488{"WRRBBW", "RB"},
30+
ans488{-1},
31+
},
32+
33+
{
34+
para488{"WWRRBBWW", "WRBRW"},
35+
ans488{2},
36+
},
37+
38+
{
39+
para488{"G", "GGGGG"},
40+
ans488{2},
41+
},
42+
43+
{
44+
para488{"RBYYBBRRB", "YRBGB"},
45+
ans488{3},
46+
},
47+
}
48+
49+
fmt.Printf("------------------------Leetcode Problem 488------------------------\n")
50+
51+
for _, q := range qs {
52+
_, p := q.ans488, q.para488
53+
fmt.Printf("【input】:%v 【output】:%v\n", p, findMinStep(p.board, p.hand))
54+
}
55+
fmt.Printf("\n\n\n")
56+
}

0 commit comments

Comments
 (0)