Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
11
Task/Permutations/Sidef/permutations-3.sidef
Normal file
11
Task/Permutations/Sidef/permutations-3.sidef
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
func permutations(callback, set, perm=[]) {
|
||||
set.is_empty && callback(perm)
|
||||
for i in ^set {
|
||||
__FUNC__(callback, [
|
||||
set[(0 ..^ i)..., (i+1 ..^ set.len)...]
|
||||
], [perm..., set[i]])
|
||||
}
|
||||
return()
|
||||
}
|
||||
|
||||
permutations({|p| say p }, [0,1,2])
|
||||
Loading…
Add table
Add a link
Reference in a new issue