Advent of code 2015 solutions https://adventofcode.com/2015/
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.

123456
  1. from itertools import combinations
  2. with open('17.txt', 'r') as file:
  3. lines = map(int, file.readlines())
  4. count = [[sum(c) for c in combinations(lines, n + 1)].count(150) for n in range(len(lines))]
  5. print("Total: %s Minimum: %s" % (sum(count), next(x for x in count if x)))