Hi,
I’m trying to get the following algorithm (done with Python) but in Julia:
from itertools import product
coins = [2, 5, 10, 20, 50, 100]
no_ways = 0
bunch_of_coins = product(*[range(0, 201, i) for i in coins])
for money in bunch_of_coins:
if sum(money) <= 200:
no_ways += 1
The closer I get is this one:
using Combinatorics
no_ways = 0
p2 = 1:100
p5 = 1:40
p10 = 1:20
p20 = 1:10
p50 = 1:4
p100 = 1:2
bunch_of_coins = collect(product(p2,p5,p10,p20,p50,p100))
...
But product
only gives tuples of 5 elements, and I would need tuples of 100 elements.
Thanks in advance.