lists

package
v1.24.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: Apache-2.0, BSD-3-Clause, Apache-2.0 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