cmb

From The K Language Wiki
Cmb
a cmb b
Supported in K7, K9

cmb takes two numbers a and b and generates all unique combinations of elements from !b that are of length a.

If a > b, returns a list of empty arrays.

4 cmb 3
0#,Ø Ø Ø Ø
 4 cmb 6
0 1 2 3
0 1 2 4
0 1 2 5
0 1 3 4
0 1 3 5
0 1 4 5
0 2 3 4
0 2 3 5
0 2 4 5
0 3 4 5
1 2 3 4
1 2 3 5
1 2 4 5
1 3 4 5
2 3 4 5