RosettaCodeData/Task/Permutations/Jq/permutations.jq

7 lines
126 B
Text
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
def permutations:
if length == 0 then []
else
range(0;length) as $i
| [.[$i]] + (del(.[$i])|permutations)
end ;