Day 03 (minified)

This commit is contained in:
Sebastian Seedorf
2021-12-04 19:57:36 +01:00
parent 37cd737f3a
commit 53abaa4d01
3 changed files with 5 additions and 0 deletions

2
day03/part2.min.py Normal file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env python3
import collections as c;n=lambda w:(f:=lambda i,l:int(''.join(l),2) if i>11else f(i+1,[s for s in l if s[i]==(max if w else min)(map(lambda x:x[::-1],c.Counter(s[i] for s in l).items()))[1]]))(0,[x.strip()for x in open("input.txt")]);print(n(0)*n(1))