AoC2020/02-2-1.py

5 lines
142 B
Python
Raw Normal View History

2020-12-03 21:36:58 +00:00
def f(k):
2020-12-03 21:34:39 +00:00
a,b,c=*map(int,k[0].split('-')),k[1][0]
return (k[2][a-1]==c)^(k[2][b-1]==c)
2020-12-03 22:48:33 +00:00
print(sum(f(x.split()) for x in open("/dev/stdin")))