Move 2015 out of the way.

This commit is contained in:
Bert Peters
2016-12-01 11:25:19 +01:00
parent a75d14ec17
commit b37fd44fa7
50 changed files with 0 additions and 0 deletions

23
2015/day-05/solution.py Normal file
View File

@@ -0,0 +1,23 @@
from __future__ import print_function
import fileinput
import re
nice1 = 0
nice2 = 0
doubleletter = re.compile(r"(.)\1")
vowels = re.compile(r"[aeiou]")
forbidden = re.compile(r"ab|cd|pq|xy")
inbetween = re.compile(r"(.).\1")
twodouble = re.compile(r"(.)(.)(.*?)\1\2")
for line in fileinput.input():
if len(vowels.findall(line)) >= 3 and doubleletter.search(line) and not forbidden.search(line):
nice1 += 1
if inbetween.search(line) and twodouble.search(line):
nice2 += 1
print(nice1, "nice1 strings.")
print(nice2, "nice2 strings.")