-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
/
Copy path402. Remove K Digits_test.go
77 lines (62 loc) · 987 Bytes
/
402. Remove K Digits_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package leetcode
import (
"fmt"
"testing"
)
type question402 struct {
para402
ans402
}
// para 是参数
// one 代表第一个参数
type para402 struct {
num string
k int
}
// ans 是答案
// one 代表第一个答案
type ans402 struct {
one string
}
func Test_Problem402(t *testing.T) {
qs := []question402{
{
para402{"10", 1},
ans402{"0"},
},
{
para402{"1111111", 3},
ans402{"1111"},
},
{
para402{"5337", 2},
ans402{"33"},
},
{
para402{"112", 1},
ans402{"11"},
},
{
para402{"1432219", 3},
ans402{"1219"},
},
{
para402{"10200", 1},
ans402{"200"},
},
{
para402{"10", 2},
ans402{"0"},
},
{
para402{"19", 2},
ans402{"0"},
},
}
fmt.Printf("------------------------Leetcode Problem 402------------------------\n")
for _, q := range qs {
_, p := q.ans402, q.para402
fmt.Printf("【input】:%v 【output】:%v\n", p, removeKdigits(p.num, p.k))
}
fmt.Printf("\n\n\n")
}