13 lines
214 B
Text
13 lines
214 B
Text
F comb(arr, k)
|
|
I k == 0
|
|
R [[Int]()]
|
|
|
|
[[Int]] result
|
|
L(x) arr
|
|
V i = L.index
|
|
L(suffix) comb(arr[i+1..], k-1)
|
|
result [+]= x [+] suffix
|
|
|
|
R result
|
|
|
|
print(comb([0, 1, 2, 3, 4], 3))
|