1
0
Fork 0
adventofcode/2015/5/nice2.py

6 lines
201 B
Python
Executable File

#!/usr/bin/python3
import sys, re
rule1 = re.compile(r"([a-z]{2}).*\1")
rule2 = re.compile(r"([a-z]).\1")
print(len([1 for line in sys.stdin.readlines() if rule1.search(line) and rule2.search(line)]))