Skip to content

Instantly share code, notes, and snippets.

@lhwork
Created October 24, 2012 06:28
Show Gist options
  • Save lhwork/3944380 to your computer and use it in GitHub Desktop.
Save lhwork/3944380 to your computer and use it in GitHub Desktop.
两行代码实现全排列
-module(libmis).
-export([perms/1]).
perms([]) -> [[]];
perms(L) -> [ [H|T] || H <- L, T <- perms(L--[H])].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment