adventofcode-2021/08/solve01.py

13 lines
206 B
Python
Raw Normal View History

2021-12-08 22:15:44 +01:00
#!/usr/bin/python
import sys
count = 0
with open("input01.txt","r") as f:
for line in f:
tokens = line.strip().split(' ')
for n in tokens[-4:]:
if len(n) in (2,3,4,7):
count += 1
print(count)