all-selections ( seq n -- seq' )


Vocabulary
math.combinatorics

Inputs
seqa sequence
nan integer


Outputs
seq'a sequence


Word description
Returns all the ways to take n (possibly the same) items from the sequence of items.

Examples
USING: math.combinatorics prettyprint ; { 1 2 } 2 all-selections .
{ { 1 1 } { 1 2 } { 2 1 } { 2 2 } }


Definition