Solve day 7
This commit is contained in:
6
07/puzzle.py
Normal file
6
07/puzzle.py
Normal 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))
|
Reference in New Issue
Block a user