RosettaCodeData/Task/Permutations/Julia/permutations-1.jl

2 lines
87 B
Julia
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
julia> perms(l) = isempty(l) ? [l] : [[x; y] for x in l for y in perms(setdiff(l, x))]