adventofcode-2021/day03/part1.py

4 lines
135 B
Python
Raw Normal View History

2021-12-03 14:38:56 +01:00
import sys
2021-12-03 14:52:49 +01:00
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))