AoC2020/02-2-1.py
2020-12-03 22:34:39 +01:00

5 lines
158 B
Python

def chk(k):
a,b,c=*map(int,k[0].split('-')),k[1][0]
return (k[2][a-1]==c)^(k[2][b-1]==c)
print(sum(chk(x.split()) for x in open("/dev/stdin").readlines()))