You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have thought of five numbers. If I add three of them in each possible way, the totals that I get are 10, 14, 15, 16, 17, 17, 18, 21, 22 and 24. What are my numbers?
#Below conditions give right solution of result = [(2, 3, 5, 9, 10)]
result = [seq for seq in itertools.combinations(possinp, 5) if sum(seq) == 29 and sum(seq[2:]) == 24 and sum(seq[:3]) == 10 and sum(seq[1:4]) == 17 ]
#result = [seq for seq in itertools.combinations(possinp, 5) if sum(seq) == 29 and sum(seq[2:]) == 24 and sum(seq[:3]) == 10 and sum(seq[1:4]) == 17 and seq[0]+seq[1]+seq[3] == 14]