Skip to content

Commit 3ef9e86

Browse files
committed
day 6
1 parent a5f9b99 commit 3ef9e86

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

day06/main.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
from collections import Counter
22

33
with open("input.txt") as f:
4-
lines = [x.strip() for x in f]
5-
6-
grps = []
7-
g = []
8-
for line in lines:
9-
if len(line) == 0:
10-
grps.append(g)
11-
g = []
12-
else:
13-
g.append(line)
14-
grps.append(g)
4+
grps = [x.strip().split() for x in f.read().split("\n\n")]
155

166
print(sum([len(Counter("".join(g))) for g in grps]))
177
print(sum([len([v for v in Counter("".join(g)).values() if v == len(g)]) for g in grps]))

0 commit comments

Comments
 (0)