-
Notifications
You must be signed in to change notification settings - Fork 670
/
Copy pathd_test.go
39 lines (37 loc) · 881 Bytes
/
d_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
// Code generated by copypasta/template/leetcode/generator_test.go
package main
import (
"github.com/EndlessCheng/codeforces-go/leetcode/testutil"
"testing"
)
func Test(t *testing.T) {
t.Log("Current test is [d]")
examples := [][]string{
{
`[5,1,3]`, `[9,4,2,3,4]`,
`2`,
},
{
`[6,4,8,1,3,2]`, `[4,7,6,2,3,8,6,1]`,
`3`,
},
// TODO 测试入参最小的情况
{
`[16,7,20,11,15,13,10,14,6,8]`, `[11,14,15,7,5,5,6,10,11,6]`,
`6`,
},
{
`[5,10,8,11,3,15,9,20,18,13]`, `[15,8,2,9,11,20,8,11,7,2]`,
`7`,
},
{
`[17,5,7,1,2,19,4,20,10,18]`, `[2,10,5,9,9,17,8,1,19,1]`,
`7`,
},
}
targetCaseNum := 2
if err := testutil.RunLeetCodeFuncWithExamples(t, minOperations, examples, targetCaseNum); err != nil {
t.Fatal(err)
}
}
// https://leetcode-cn.com/contest/weekly-contest-222/problems/minimum-operations-to-make-a-subsequence/