Skip to content

Instantly share code, notes, and snippets.

@elbrujohalcon
Created August 23, 2019 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elbrujohalcon/6fc784894e14d07694edd8298221380b to your computer and use it in GitHub Desktop.
Save elbrujohalcon/6fc784894e14d07694edd8298221380b to your computer and use it in GitHub Desktop.
-module joe.
-export [test/0, perms/1].
test() ->
[[]] = joe:perms(""),
["a"] = joe:perms("a"),
["ab", "ba"] = joe:perms("ab"),
["ba", "ab"] = joe:perms("ba"),
["123","132","213","231","312","321"] = joe:perms("123"),
ok.
perms([]) -> [[]].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment