mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-05 00:25:22 +08:00
add: leetcode 396 test
This commit is contained in:
46
leetcode/0396.Rotate-Function/396. Rotate Function_test.go
Normal file
46
leetcode/0396.Rotate-Function/396. Rotate Function_test.go
Normal file
@ -0,0 +1,46 @@
|
||||
package leetcode
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
type question396 struct {
|
||||
para396
|
||||
ans396
|
||||
}
|
||||
|
||||
// para 是参数
|
||||
// one 代表第一个参数
|
||||
type para396 struct {
|
||||
one []int
|
||||
}
|
||||
|
||||
// ans 是答案
|
||||
// one 代表第一个答案
|
||||
type ans396 struct {
|
||||
one int
|
||||
}
|
||||
|
||||
func Test_Problem396(t *testing.T) {
|
||||
|
||||
qs := []question396{
|
||||
{
|
||||
para396{[]int{4, 3, 2, 6}},
|
||||
ans396{26},
|
||||
},
|
||||
|
||||
{
|
||||
para396{[]int{100}},
|
||||
ans396{0},
|
||||
},
|
||||
}
|
||||
|
||||
fmt.Printf("------------------------Leetcode Problem 396------------------------\n")
|
||||
|
||||
for _, q := range qs {
|
||||
_, p := q.ans396, q.para396
|
||||
fmt.Printf("【input】:%v 【output】:%v\n", p, maxRotateFunction(p.one))
|
||||
}
|
||||
fmt.Printf("\n\n\n")
|
||||
}
|
Reference in New Issue
Block a user