September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -1,12 +0,0 @@
combos = (arr, k) ->
return [ [] ] if k == 0
return [] if arr.length == 0
combos_with_head = ([arr[0]].concat combo for combo in combos arr, k-1)
combos_sans_head = combos arr[1...], k
combos_with_head.concat combos_sans_head
arr = ['iced', 'jam', 'plain']
console.log "valid pairs from #{arr.join ','}:"
console.log combos arr, 2
console.log "#{combos([1..10], 3).length} ways to order 3 donuts given 10 types"

View file

@ -1,8 +0,0 @@
jam,plain:
[ [ 'iced', 'iced' ],
[ 'iced', 'jam' ],
[ 'iced', 'plain' ],
[ 'jam', 'jam' ],
[ 'jam', 'plain' ],
[ 'plain', 'plain' ] ]
220 ways to order 3 donuts given 10 types