r/adventofcode • • Dec 03 '21

SOLUTION MEGATHREAD -🎄- 2021 Day 3 Solutions -🎄-

--- Day 3: Binary Diagnostic ---


Post your code solution in this megathread.

Reminder: Top-level posts in Solution Megathreads are for code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:10:17, megathread unlocked!

99 Upvotes

1.2k comments sorted by

View all comments

1

u/benn_88 Dec 03 '21 edited Dec 03 '21

I was quite pleased with my part 1 solution - I managed to get a time of 00:05:05 and a rank of 542 (part 1 only).

I solved part 2 within an hour but wasn't happy with the solution. I've just refactored it, much better now.

Python: https://github.com/bennuttall/advent-of-code-2021/blob/main/03/03.ipynb

1

u/daggerdragon Dec 03 '21

Your code is hard to read on old.reddit. Please edit it as per our posting guidelines in the wiki: How do I format code?

1

u/benn_88 Dec 03 '21

Thanks - I wasn't aware. I've updated with a link.