Skip to content

Instantly share code, notes, and snippets.

@Ffisegydd

Ffisegydd/3.py Secret

Created December 3, 2016 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ffisegydd/6595c9285d5decc11d29139bbf87298c to your computer and use it in GitHub Desktop.
Save Ffisegydd/6595c9285d5decc11d29139bbf87298c to your computer and use it in GitHub Desktop.
from itertools import combinations
with open('data/3.txt') as f:
print(sum(all(sum(com)/sum(d) > 0.5 for com in combinations(d, 2)) for d in [tuple(int(n) for n in l.strip().split()) for l in f]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment