Files
advent-of-code-2023/07/puzzle.py
2023-12-12 22:35:04 -08:00

7 lines
233 B
Python

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))