Skip to content

Commit

Permalink
Start on day 11 part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dale-c-anderson committed Dec 12, 2022
1 parent 9191a1e commit 9809c77
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions 2022/11/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@

def main(data0):

data0 = data0.split('\n\n')

if args.part1 or not args.part2:
part1_answer = part1(data0.split('\n\n'))
part1_answer = part1(data0)
print(f'Part 1: {part1_answer}')

if args.part2 or not args.part1:
part2_answer = part2(data0.splitlines())
part2_answer = part2(data0)
print(f'Part 2: {part2_answer}')


Expand Down Expand Up @@ -119,7 +121,12 @@ def process_worry_level(old_worry_level, operation_def):


def part2(data):
pass
global monkeys
monkeys = []
parse_config(data)
do_rounds(200)
two_highest = sorted(monkeys, key=lambda k: k['items_inspected'], reverse=True)[:2]
return two_highest[0]['items_inspected'] * two_highest[1]['items_inspected']


if __name__ == "__main__":
Expand Down

0 comments on commit 9809c77

Please sign in to comment.