lists

package
v1.19.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2019 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Combinations

func Combinations(list []string, pick int) (all [][]string)

Combinations returns all possible unique selections of size `pick` of a list of strings for which order does not matter

an example:

Combinations([cat, dog, bird], 2):
  [cat] -> Combinations([dog, bird], 1)
    [cat, dog]
    [cat, bird]
  [dog] -> Combinations([bird], 1)
    [dog, bird]
  [bird] -> Combinations([], 0)
    n/a

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL