aoc/2018/02/part1.py

15 lines
450 B
Python
Raw Permalink Normal View History

2018-12-02 05:58:35 +00:00
with open('input.txt') as input:
lines = [line.strip('\n') for line in input.readlines()]
two = 0
three = 0
for line in lines:
for char in 'qwertyuiopasdfghjklzxcvbnm':
if line.count(char) == 2:
two += 1
break
for char in 'qwertyuiopasdfghjklzxcvbnm':
if line.count(char) == 3:
three += 1
break
print(two, three, two * three)