func (s Set) Sample(n int) Set {
	c := make(Set, n)
	for x := range s {
		if n == 0 {
			break
		}
		c.Add(x)
		n--
	}
	return s
}
Sample samples n random elements from s. If there are <= n elements in s,
returns the whole set.
package stringset
import "errors"
type Set map[string]struct{}
func FromSlice(xs []string) Set {
	s := make(Set)
	for _, x := range xs {
		s.Add(x)
	}
	return s
}
func New(xs ...string) Set {
	return FromSlice(xs)
}
func (s Set) Add(x string) {
	s[x] = struct{}{}
}
func (s Set) Remove(x string) {
	delete(s, x)
}
func (s Set) Has(x string) bool {
	_, ok := s[x]
	return ok
}
func (s Set) Sub(s2 Set) Set {
	result := make(Set)
	for x := range s {
		if !s2.Has(x) {
			result.Add(x)
		}
	}
	return result
}
func (s Set) ToSlice() []string {
	var xs []string
	for x := range s {
		xs = append(xs, x)
	}
	return xs
}
func Equal(s1 Set, s2 Set) bool {
	if len(s1) != len(s2) {
		return false
	}
	for x := range s1 {
		if !s2.Has(x) {
			return false
		}
	}
	return true
}
func (s Set) Copy() Set {
	c := make(Set, len(s))
	for x := range s {
		c.Add(x)
	}
	return c
}
func (s Set) Random() (string, error) {
	for x := range s {
		return x, nil
	}
	return "", errors.New("set is empty")
}