mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-04 16:12:47 +08:00
48 lines
756 B
Go
48 lines
756 B
Go
package leetcode
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
type question684 struct {
|
|
para684
|
|
ans684
|
|
}
|
|
|
|
// para 是参数
|
|
// one 代表第一个参数
|
|
type para684 struct {
|
|
one [][]int
|
|
}
|
|
|
|
// ans 是答案
|
|
// one 代表第一个答案
|
|
type ans684 struct {
|
|
one []int
|
|
}
|
|
|
|
func Test_Problem684(t *testing.T) {
|
|
|
|
qs := []question684{
|
|
|
|
{
|
|
para684{[][]int{{1, 2}, {1, 3}, {2, 3}}},
|
|
ans684{[]int{2, 3}},
|
|
},
|
|
|
|
{
|
|
para684{[][]int{{1, 2}, {2, 3}, {3, 4}, {1, 4}, {1, 5}}},
|
|
ans684{[]int{1, 4}},
|
|
},
|
|
}
|
|
|
|
fmt.Printf("------------------------Leetcode Problem 684------------------------\n")
|
|
|
|
for _, q := range qs {
|
|
_, p := q.ans684, q.para684
|
|
fmt.Printf("【input】:%v 【output】:%v\n", p, findRedundantConnection(p.one))
|
|
}
|
|
fmt.Printf("\n\n\n")
|
|
}
|