mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-05 00:25:22 +08:00
45 lines
671 B
Go
45 lines
671 B
Go
package leetcode
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
type question815 struct {
|
|
para815
|
|
ans815
|
|
}
|
|
|
|
// para 是参数
|
|
// one 代表第一个参数
|
|
type para815 struct {
|
|
r [][]int
|
|
s int
|
|
t int
|
|
}
|
|
|
|
// ans 是答案
|
|
// one 代表第一个答案
|
|
type ans815 struct {
|
|
one int
|
|
}
|
|
|
|
func Test_Problem815(t *testing.T) {
|
|
|
|
qs := []question815{
|
|
|
|
{
|
|
para815{[][]int{{1, 2, 7}, {3, 6, 7}}, 1, 6},
|
|
ans815{2},
|
|
},
|
|
}
|
|
|
|
fmt.Printf("------------------------Leetcode Problem 815------------------------\n")
|
|
|
|
for _, q := range qs {
|
|
_, p := q.ans815, q.para815
|
|
fmt.Printf("【input】:%v 【output】:%v\n", p, numBusesToDestination(p.r, p.s, p.t))
|
|
}
|
|
fmt.Printf("\n\n\n")
|
|
}
|