forked from halfrost/LeetCode-Go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path48. Rotate Image_test.go
50 lines (40 loc) · 967 Bytes
/
48. Rotate Image_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
package leetcode
import (
"fmt"
"testing"
)
type question48 struct {
para48
ans48
}
// para 是参数
// one 代表第一个参数
type para48 struct {
s [][]int
}
// ans 是答案
// one 代表第一个答案
type ans48 struct {
s [][]int
}
func Test_Problem48(t *testing.T) {
qs := []question48{
question48{
para48{[][]int{[]int{1, 2, 3}, []int{4, 5, 6}, []int{7, 8, 9}}},
ans48{[][]int{[]int{7, 4, 1}, []int{8, 5, 2}, []int{9, 6, 3}}},
},
question48{
para48{[][]int{[]int{5, 1, 9, 11}, []int{2, 4, 8, 10}, []int{13, 3, 6, 7}, []int{15, 14, 12, 16}}},
ans48{[][]int{[]int{15, 13, 2, 5}, []int{14, 3, 4, 1}, []int{12, 6, 8, 9}, []int{16, 7, 10, 11}}},
},
}
fmt.Printf("------------------------Leetcode Problem 48------------------------\n")
for _, q := range qs {
_, p := q.ans48, q.para48
fmt.Printf("【input】:%v \n", p)
rotate(p.s)
fmt.Printf("【output】:%v\n", p)
fmt.Printf("\n")
}
fmt.Printf("\n\n\n")
}