Solve day 7

This commit is contained in:
Nettika
2023-12-12 22:35:04 -08:00
parent d36993c895
commit 2cd901b1de
6 changed files with 1448 additions and 0 deletions

6
07/puzzle.py Normal file
View File

@@ -0,0 +1,6 @@
from hand import Hand
def solve(hand_descs: list[str], joker_mode=False):
hands = sorted(Hand.parse(hand_desc, joker_mode) for hand_desc in hand_descs)
return sum((index + 1) * hand.bid for index, hand in enumerate(hands))