diff --git a/leetcode/0495.Teemo-Attacking/495.Teemo Attacking_test.go b/leetcode/0495.Teemo-Attacking/495.Teemo Attacking_test.go new file mode 100644 index 00000000..2900a11f --- /dev/null +++ b/leetcode/0495.Teemo-Attacking/495.Teemo Attacking_test.go @@ -0,0 +1,46 @@ +package leetcode + +import ( + "fmt" + "testing" +) + +type question495 struct { + para495 + ans495 +} + +// para 是参数 +type para495 struct { + timeSeries []int + duration int +} + +// ans 是答案 +type ans495 struct { + ans int +} + +func Test_Problem495(t *testing.T) { + + qs := []question495{ + + { + para495{[]int{1, 4}, 2}, + ans495{4}, + }, + + { + para495{[]int{1, 2}, 2}, + ans495{3}, + }, + } + + fmt.Printf("------------------------Leetcode Problem 495------------------------\n") + + for _, q := range qs { + _, p := q.ans495, q.para495 + fmt.Printf("【input】:%v 【output】:%v\n", p, findPoisonedDuration(p.timeSeries, p.duration)) + } + fmt.Printf("\n\n\n") +}