tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
1
Task/Permutations/Groovy/permutations-1.groovy
Normal file
1
Task/Permutations/Groovy/permutations-1.groovy
Normal file
|
|
@ -0,0 +1 @@
|
|||
def makePermutations = { l -> l.permutations() }
|
||||
4
Task/Permutations/Groovy/permutations-2.groovy
Normal file
4
Task/Permutations/Groovy/permutations-2.groovy
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
def list = ['Crosby', 'Stills', 'Nash', 'Young']
|
||||
def permutations = makePermutations(list)
|
||||
assert permutations.size() == (1..<(list.size()+1)).inject(1) { prod, i -> prod*i }
|
||||
permutations.each { println it }
|
||||
Loading…
Add table
Add a link
Reference in a new issue