示例#1
0
// a + b
func scpUnion(a, b []int) []int {
	sa := setFromIntSlice(a)
	sb := setFromIntSlice(b)
	sc := set.Union(sa, sb)
	c := set.IntSlice(sc)
	orderScp(c)
	return c
}
示例#2
0
// ab
func scpIntsc(a, b []int) []int {
	sa := setFromIntSlice(a)
	sb := setFromIntSlice(b)
	sc := set.Intersection(sa, sb)
	c := set.IntSlice(sc)
	orderScp(c)
	return c
}
示例#3
0
// a\b
func scpDiff(a, b []int) []int {
	sa := setFromIntSlice(a)
	sb := setFromIntSlice(b)
	sc := set.Difference(sa, sb)
	c := set.IntSlice(sc)
	orderScp(c)
	return c
}