lists

package
v1.59.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 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

func RepeatString

func RepeatString(s string, n int) []string

RepeatString returns a new slice with the string s repeated n times.

Types

This section is empty.

Jump to

Keyboard shortcuts

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