Combinatorica`
Combinatorica`
KSubsets
KSubsets[l,k]
gives all subsets of set l containing exactly k elements, ordered lexicographically.
Details and Options
- To use KSubsets, you first need to load the Combinatorica Package using Needs["Combinatorica`"].