diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-03 16:56:16 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-03 16:56:54 +0000 |
commit | d75a9d510ced0a29ad2fe7ebc247dc7b0766320c (patch) | |
tree | 3bf55422bf79ce41ac62e20da7906321c2ec8992 /3.py | |
parent | b5d1f2d79bb61afd9b03621282b7bff5f29a75f1 (diff) | |
download | aoc2021-d75a9d510ced0a29ad2fe7ebc247dc7b0766320c.tar.gz aoc2021-d75a9d510ced0a29ad2fe7ebc247dc7b0766320c.tar.xz aoc2021-d75a9d510ced0a29ad2fe7ebc247dc7b0766320c.zip |
Implement open_day utility function
Diffstat (limited to '3.py')
-rw-r--r-- | 3.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,3 +1,5 @@ +from utils import open_day + Bits = tuple[bool, ...] Input = list[Bits] @@ -25,7 +27,7 @@ def part2(nums: Input) -> int: co2: Bits = part2_impl(nums, True) return bits_to_int(oxygen) * bits_to_int(co2) -inp: Input = [tuple(c == '1' 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_day(3)] print(part1(inp)) print(part2(inp)) |