all-combinations ( seq k -- seq' )


Vocabulary
math.combinatorics

Inputs and outputs
seqa sequence
ka non-negative integer
seq'a sequence


Word description
Outputs a sequence containing all combinations of seq choosing k elements, in lexicographical order.

Examples
USING: math.combinatorics prettyprint ; { "a" "b" "c" "d" } 2 all-combinations .
{ { "a" "b" } { "a" "c" } { "a" "d" } { "b" "c" } { "b" "d" } { "c" "d" } }


Definition