mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-25 12:14:26 +08:00
规范格式
This commit is contained in:
@ -0,0 +1,72 @@
|
||||
package leetcode
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
type question928 struct {
|
||||
para928
|
||||
ans928
|
||||
}
|
||||
|
||||
// para 是参数
|
||||
// one 代表第一个参数
|
||||
type para928 struct {
|
||||
graph [][]int
|
||||
initial []int
|
||||
}
|
||||
|
||||
// ans 是答案
|
||||
// one 代表第一个答案
|
||||
type ans928 struct {
|
||||
one int
|
||||
}
|
||||
|
||||
func Test_Problem928(t *testing.T) {
|
||||
|
||||
qs := []question928{
|
||||
|
||||
question928{
|
||||
para928{[][]int{[]int{1, 0, 0, 0}, []int{0, 1, 1, 1}, []int{0, 1, 1, 0}, []int{0, 1, 0, 1}}, []int{1, 3}},
|
||||
ans928{1},
|
||||
},
|
||||
question928{
|
||||
para928{[][]int{[]int{1, 1, 1, 0}, []int{1, 1, 0, 0}, []int{1, 0, 1, 0}, []int{0, 0, 0, 1}}, []int{3, 2}},
|
||||
ans928{2},
|
||||
},
|
||||
|
||||
question928{
|
||||
para928{[][]int{[]int{1, 1, 0}, []int{1, 1, 1}, []int{0, 1, 1}}, []int{0, 1}},
|
||||
ans928{1},
|
||||
},
|
||||
|
||||
question928{
|
||||
para928{[][]int{[]int{1, 1, 0}, []int{1, 1, 0}, []int{0, 0, 1}}, []int{0, 1}},
|
||||
ans928{0},
|
||||
},
|
||||
|
||||
question928{
|
||||
para928{[][]int{[]int{1, 1, 0, 0}, []int{1, 1, 1, 0}, []int{0, 1, 1, 1}, []int{0, 0, 1, 1}}, []int{0, 1}},
|
||||
ans928{1},
|
||||
},
|
||||
|
||||
question928{
|
||||
para928{[][]int{[]int{1, 0, 0, 0}, []int{0, 1, 0, 0}, []int{0, 0, 1, 1}, []int{0, 0, 1, 1}}, []int{3, 1}},
|
||||
ans928{3},
|
||||
},
|
||||
|
||||
question928{
|
||||
para928{[][]int{[]int{1, 0, 0, 0, 0, 0}, []int{0, 1, 0, 0, 0, 0}, []int{0, 0, 1, 0, 0, 0}, []int{0, 0, 0, 1, 1, 0}, []int{0, 0, 0, 1, 1, 0}, []int{0, 0, 0, 0, 0, 1}}, []int{5, 0}},
|
||||
ans928{0},
|
||||
},
|
||||
}
|
||||
|
||||
fmt.Printf("------------------------Leetcode Problem 928------------------------\n")
|
||||
|
||||
for _, q := range qs {
|
||||
_, p := q.ans928, q.para928
|
||||
fmt.Printf("【input】:%v 【output】:%v\n", p, minMalwareSpread2(p.graph, p.initial))
|
||||
}
|
||||
fmt.Printf("\n\n\n")
|
||||
}
|
Reference in New Issue
Block a user