Skip to content

Commit

Permalink
Simplify solution to 2023-12-02 a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
fuglede committed Dec 3, 2023
1 parent 5572513 commit 4d3287d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions 2023/day02/solutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
colormax = defaultdict(int)
for count, color in zip(parts[2::2], parts[3::2]):
colormax[color] = max(colormax[color], int(count))
power = math.prod(colormax.values())
if colormax["red"] <= 12 and colormax["green"] <= 13 and colormax["blue"] <= 14:
good_ids += int(parts[1])
total_power += power
total_power += math.prod(colormax.values())

# Part 1
print(good_ids)
Expand Down

0 comments on commit 4d3287d

Please sign in to comment.