How can I get permutations of a list in Elixir?
Eg, for [\"a\", \"b\", \"c\"], I would expect:
[\"a\", \"b\", \"c\"]
# [[\"a\", \"b\", \"c\"], [\"a\", \"c\",
Like this:
defmodule Permutations do def of([]) do [[]] end def of(list) do for h <- list, t <- of(list -- [h]), do: [h | t] end end