From f02578eae0555c4ad03582a9fc25b0ea1e929c29 Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Thu, 3 Dec 2020 22:36:58 +0100 Subject: [PATCH] Shorter --- 02-2-1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/02-2-1.py b/02-2-1.py index a3ce182..b22c1f3 100644 --- a/02-2-1.py +++ b/02-2-1.py @@ -1,4 +1,4 @@ -def chk(k): +def f(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())) +print(sum(f(x.split()) for x in open("/dev/stdin").readlines()))