adventofcode-2021/day03/part1.py
Felix Van der Jeugt 39af5faeec
delay booling
2021-12-03 14:52:49 +01:00

4 lines
135 B
Python

import sys
m=''.join(["01","10"][sum(f=="1"for f in c)<len(c)/2]for c in zip(*open(sys.argv[3])))
print(int(m[1::2],2)*int(m[0::2],2))