Skip to content

Commit

Permalink
fix(day-7): Use joker value 1
Browse files Browse the repository at this point in the history
  • Loading branch information
CaedenPH committed Dec 7, 2023
1 parent bd76a6e commit 2662458
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Advent of Code/2023/day_07.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ def parse_raw(raw: str):
data = parse_raw(raw)


def solve(types):
def solve(types, p2=False):
flatten = []
for type in types[::-1]:
def sorter(card):
hierachy = {
"A": 14,
"K": 13,
"Q": 12,
"J": 11,
"J": 1 if p2 else 11,
"T": 10
}
vcard = 0
Expand Down Expand Up @@ -131,7 +131,7 @@ def part_two(data=data):
types[5].append(hand)
elif most_common == 1 and len(charcount) == 5:
types[6].append(hand)
return solve(types)
return solve(types, True)


aoc_helper.lazy_test(day=7, year=2023, parse=parse_raw, solution=part_two)
Expand Down

0 comments on commit 2662458

Please sign in to comment.