mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-05 00:25:22 +08:00
50 lines
782 B
Go
50 lines
782 B
Go
package leetcode
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
type question566 struct {
|
|
para566
|
|
ans566
|
|
}
|
|
|
|
// para 是参数
|
|
// one 代表第一个参数
|
|
type para566 struct {
|
|
nums [][]int
|
|
r int
|
|
c int
|
|
}
|
|
|
|
// ans 是答案
|
|
// one 代表第一个答案
|
|
type ans566 struct {
|
|
one [][]int
|
|
}
|
|
|
|
func Test_Problem566(t *testing.T) {
|
|
|
|
qs := []question566{
|
|
|
|
{
|
|
para566{[][]int{{1, 2}, {3, 4}}, 1, 4},
|
|
ans566{[][]int{{1, 2, 3, 4}}},
|
|
},
|
|
|
|
{
|
|
para566{[][]int{{1, 2}, {3, 4}}, 2, 4},
|
|
ans566{[][]int{{1, 2}, {3, 4}}},
|
|
},
|
|
}
|
|
|
|
fmt.Printf("------------------------Leetcode Problem 566------------------------\n")
|
|
|
|
for _, q := range qs {
|
|
_, p := q.ans566, q.para566
|
|
fmt.Printf("【input】:%v 【output】:%v\n", p, matrixReshape(p.nums, p.r, p.c))
|
|
}
|
|
fmt.Printf("\n\n\n")
|
|
}
|