summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2021-12-03 14:59:51 +0000
committerTomasz Kramkowski <tk@the-tk.com>2021-12-03 14:59:51 +0000
commit782d739bdff1c53dce069676e2622a8a2231963b (patch)
treeda617eb9e68435453c78d43e383ac9842cff930c
parentc45f9100f0ad8304bc46c0e2f956cb532df26ac0 (diff)
downloadaoc2021-782d739bdff1c53dce069676e2622a8a2231963b.tar.gz
aoc2021-782d739bdff1c53dce069676e2622a8a2231963b.tar.xz
aoc2021-782d739bdff1c53dce069676e2622a8a2231963b.zip
day 3: simpler input parsing
-rw-r--r--3.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/3.py b/3.py
index 7750fa1..8d27cf2 100644
--- a/3.py
+++ b/3.py
@@ -39,7 +39,7 @@ def part2(nums: Input) -> int:
co2: Bits = part2_impl(nums, True)
return bits_to_int(oxygen) * bits_to_int(co2)
-inp: Input = [tuple(bool(int(c)) for c in l.strip()) for l in open('3.in')]
+inp: Input = [tuple(c == '1' for c in l.strip()) for l in open('3.in')]
print(part1(inp))
print(part2(inp))