Skip to content

Instantly share code, notes, and snippets.

@pawlos
Last active December 24, 2017 18:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save pawlos/7f9ba37abaecb4982f8004b291fd1ba0 to your computer and use it in GitHub Desktop.
Solution to Day 4: High-Entropy Passphrases
# aoc_4.py
lines = open('input_d4.txt','r').readlines()
lines = [w.replace('\n','').split(' ') for w in lines]
print lines
count = 0
match = True
for l in lines:
match = True
for j in range(len(l)):
for k in range(j+1, len(l)):
if l[j] == l[k]:
match = False
break
if match:
count += 1
print count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment