Skip to content

Instantly share code, notes, and snippets.

@TimCastelijns
Last active December 7, 2015 14:15
  • 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 TimCastelijns/7cbc57049efbcef7bf92 to your computer and use it in GitHub Desktop.
nice = 0
with open('day5.txt', 'r') as f:
for word in f.readlines():
# 2 overlapping.
for i in range(0, len(word), 1):
part = word[i:i+2]
if word.count(part) >= 2:
break
else:
continue
# repeated with 1 in between.
for index, c in enumerate(word):
if index < 2:
continue
if c == word[index - 2]:
break
else:
continue
nice += 1
print nice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment