From b1159a69a0ba6ee07cdf2974178d1797c8da4d0e Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Sun, 6 Dec 2020 12:22:10 +0100 Subject: [PATCH] Initial solutions day 6 --- 06-1-1.py | 1 + 06-2-1.py | 1 + 2 files changed, 2 insertions(+) create mode 100644 06-1-1.py create mode 100644 06-2-1.py diff --git a/06-1-1.py b/06-1-1.py new file mode 100644 index 0000000..0aaeb9b --- /dev/null +++ b/06-1-1.py @@ -0,0 +1 @@ +print(sum(map(lambda x:len(set(x)-set('\n')),open(0).read().split('\n'*2)))) diff --git a/06-2-1.py b/06-2-1.py new file mode 100644 index 0000000..feef9d8 --- /dev/null +++ b/06-2-1.py @@ -0,0 +1 @@ +print(sum(map(lambda x:sum((f:=x.count)(c)==(t:=f('\n')+1)for c in x)//t,open(0).read()[:-1].split('\n'*2))))