diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-03 15:15:06 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-03 15:15:06 +0000 |
commit | f7debaca045f37410bd040531f45398bfeaaf735 (patch) | |
tree | 5f5f0375223a5d10758bbfd1b2976dc06f2dbe59 | |
parent | 7ccf765434a92ac5b59b8fa85dc701e3572d9b21 (diff) | |
download | aoc2021-f7debaca045f37410bd040531f45398bfeaaf735.tar.gz aoc2021-f7debaca045f37410bd040531f45398bfeaaf735.tar.xz aoc2021-f7debaca045f37410bd040531f45398bfeaaf735.zip |
day 3 part 1: bugfix
-rw-r--r-- | 3.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -15,7 +15,7 @@ def bits_to_int(bits: Bits) -> int: return sum(b * 2 ** i for i, b in enumerate(reversed(bits))) def part1(nums: Input) -> int: - gamma: Bits = tuple(most_common(inp, i) for i in range(len(nums[0]))) + gamma: Bits = tuple(most_common(nums, i) for i in range(len(nums[0]))) epsilon: Bits = tuple(not bit for bit in gamma) return bits_to_int(gamma) * bits_to_int(epsilon) |