Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
|
|
@ -1,8 +1,8 @@
|
|||
func permutations(callback, set, perm=[]) {
|
||||
set.is_empty && callback(perm)
|
||||
set || callback(perm)
|
||||
for i in ^set {
|
||||
__FUNC__(callback, [
|
||||
set[(0 ..^ i)..., (i+1 ..^ set.len)...]
|
||||
set[^i, i+1 ..^ set.len]
|
||||
], [perm..., set[i]])
|
||||
}
|
||||
return()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue