A repro for all my Advent of ode tasks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

17 lines
372 B

import itertools
containers = []
combos = {}
file = open('input.txt', 'r')
for line in file:
containers.append(int(line))
count = 0
for i in range(2, len(containers)-1):
for perm in itertools.combinations(containers, i):
if sum(perm) == 150:
count += 1
combos.setdefault(i, 0)
combos[i] += 1
print(count)
print(combos)