mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-05 00:25:22 +08:00
48 lines
719 B
Go
48 lines
719 B
Go
package leetcode
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
type question78 struct {
|
|
para78
|
|
ans78
|
|
}
|
|
|
|
// para 是参数
|
|
// one 代表第一个参数
|
|
type para78 struct {
|
|
one []int
|
|
}
|
|
|
|
// ans 是答案
|
|
// one 代表第一个答案
|
|
type ans78 struct {
|
|
one [][]int
|
|
}
|
|
|
|
func Test_Problem78(t *testing.T) {
|
|
|
|
qs := []question78{
|
|
|
|
{
|
|
para78{[]int{}},
|
|
ans78{[][]int{{}}},
|
|
},
|
|
|
|
{
|
|
para78{[]int{1, 2, 3}},
|
|
ans78{[][]int{{}, {1}, {2}, {3}, {1, 2}, {2, 3}, {1, 3}, {1, 2, 3}}},
|
|
},
|
|
}
|
|
|
|
fmt.Printf("------------------------Leetcode Problem 78------------------------\n")
|
|
|
|
for _, q := range qs {
|
|
_, p := q.ans78, q.para78
|
|
fmt.Printf("【input】:%v 【output】:%v\n", p, subsets(p.one))
|
|
}
|
|
fmt.Printf("\n\n\n")
|
|
}
|