Skip to content

Instantly share code, notes, and snippets.

@TimCastelijns TimCastelijns/5-2.py

Last active Dec 7, 2015
Embed
What would you like to do?
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
You can’t perform that action at this time.