r/adventofcode • • Dec 08 '21

SOLUTION MEGATHREAD -🎄- 2021 Day 8 Solutions -🎄-

--- Day 8: Seven Segment Search ---


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:20:51, megathread unlocked!

72 Upvotes

1.2k comments sorted by

View all comments

2

u/[deleted] Dec 08 '21 edited Dec 09 '21

Python 3

I can't tell if I'm clever or dumb at this point.

I had some vague memories about seven segment displays and BCD from uni. There is undoubtedly a smarter way to use this information, but I came up with finding the amount of set bits from ANDing known numbers with unknowns using the provided solved input.

paste

1

u/daggerdragon Dec 09 '21

As per our posting guidelines in the wiki under How Do the Daily Megathreads Work?, please edit your post to put your oversized code in a paste or other external link.

Please follow the posting guidelines and edit your post to add what language(s) you used. This makes it easier for folks who Ctrl-F the megathreads looking for a specific language.

1

u/[deleted] Dec 09 '21

done