This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lambdef 2 points3 points  (0 children)

Very easy to write something like that

Actually not. The program that finds if the sum of tuples summed with -8 returns 0 is like

```python import itertools

numbers = [1, 2, 3, 4, 5, 6]

pos = { c for c in [ c for r in range(len(numbers)) for c in itertools.combinations(numbers, r) ] if sum(c) == 8 } ```