diff --git a/2023/day07/src/part1.py b/2023/day07/src/part1.py index 6b3554b..bd982ef 100644 --- a/2023/day07/src/part1.py +++ b/2023/day07/src/part1.py @@ -22,6 +22,7 @@ for line in lines: same.update({"value": int(bozo[1])}) sames.append(same) +#[print(same) for same in sames] def get_highest(cards1, cards2, i): if (cards1 == cards2): @@ -60,8 +61,6 @@ for same in sames[1:]: index = get_index(sort, opponent.get("key")) place = index if place == None else min(place, index) opponents = new - if (place != None): - break if (place == None): place = len(sort) sort.insert(place, same) @@ -69,6 +68,6 @@ for same in sames[1:]: for j, bozo in enumerate(sort): rank: int = (len(lines) - j) _value += rank * bozo.get("value") - print(f'{rank}, {bozo.get("key")} {bozo.get("value")}') + print(f'{rank} {bozo.get("key")} {bozo.get("value")}') print(_value) \ No newline at end of file