7 lines
126 B
Text
7 lines
126 B
Text
|
|
def permutations:
|
||
|
|
if length == 0 then []
|
||
|
|
else
|
||
|
|
range(0;length) as $i
|
||
|
|
| [.[$i]] + (del(.[$i])|permutations)
|
||
|
|
end ;
|