Created
July 21, 2012 16:25
-
-
Save cpdean/3156320 to your computer and use it in GitHub Desktop.
Trolling with phone math
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sleuth = 7+1+5 | |
target = 37 | |
simple_sum = target - sleuth # 24 | |
from itertools import combinations | |
seed = [2 for n in range(7)] + [3 for n in range(7)] + [5 for n in range(7)] | |
answers = set(a for a in combinations(seed,7) if sum(a) == simple_sum) | |
# yields 2223555 and 2333355 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment