Advent-of-Code/2015/day 5/P1/string.py

12 lines
378 B
Python
Raw Normal View History

2019-12-01 17:44:00 +01:00
strings = open("input.txt").read().split("\n")[:-1]
nice = 0
for i in strings:
if i.count("a")+i.count("e")+i.count("i")+i.count("o")+i.count("u") >= 3 \
and not ("ab" in i or "cd" in i or "pq" in i or "xy" in i):
for j in list(i):
if f"{j}{j}" in i:
nice+=1
break
print(nice)