-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Description
It's too much effort to create a branch and pull request at this point, so I'll paste the code I've been using inline:
iter permute(elts: [@T]) -> [@T] {
if vec::is_not_empty(elts) {
for each i in uint::range(0u, vec::len(elts)) {
let rest = vec::slice(elts, 0u, i);
rest += vec::slice(elts, i + 1u, vec::len(elts));
for each permutation in permute(tmp) {
put [elts[i]] + permutation;
}
}
} else {
put [];
}
}Metadata
Metadata
Assignees
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.