diff --git a/3/rucksack.py b/3/rucksack.py index 838dd31..f3e260f 100644 --- a/3/rucksack.py +++ b/3/rucksack.py @@ -56,10 +56,8 @@ if __name__ == "__main__": print(f"sum of priorities of all common items amongst compartments: {answer_a}") submit(answer_a, part="a", day=3, year=2022) - # part b: determine the priority of common items in groups of three - # split the supply list into groups of three + # part b: determine the priority of common items in groups of three and create a priority summary groups = [supplies[i : i + 3] for i in range(0, len(supplies), 3)] - # create a list of each groups priority and sum it all up answer_b = sum([eval_badge_priority(group) for group in groups]) print(f"sum of priorities of all common items amongst groups of three: {answer_b}") submit(answer_b, part="b", day=3, year=2022)