RosettaCodeData/Task/Combinations/Icon/combinations-2.icon
2023-07-01 13:44:08 -04:00

8 lines
178 B
Text

procedure lcomb(L,i) #: list combinations
local j
if i < 1 then fail
suspend if i = 1 then [!L]
else [L[j := 1 to *L - i + 1]] ||| lcomb(L[j + 1:0],i - 1)
end