Advent of code 2015 solutions https://adventofcode.com/2015/
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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)))