Initial release
This commit is contained in:
14
Somme Limite.py
Normal file
14
Somme Limite.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from itertools import combinations
|
||||
|
||||
input = [32, 37, 41, 42, 45, 49, 50, 51, 17, 54, 55, 28, 62]
|
||||
MAX = 249
|
||||
|
||||
table = list(combinations(input, 2)) + list(combinations(input, 3)) + list(combinations(input, 4)) + list(combinations(input, 5)) + list(combinations(input, 6)) + list(combinations(input, 7))
|
||||
|
||||
ctr = 0
|
||||
for i in table:
|
||||
if sum(i) <= MAX:
|
||||
ctr += 1
|
||||
|
||||
print(ctr)
|
||||
|
||||
Reference in New Issue
Block a user