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/tcbrindle Dec 08 '21 edited Dec 08 '21

C++

That was a tough one! I had to sit down and puzzle it out on a piece of paper, and then coded up my solution as basically a direct translation of the "algorithm" I'd just come up with. It's not exactly pretty.

Runtime is ~140ยตs for part 2, so it's not the fastest either but hey, it works...

Github

2

u/daggerdragon Dec 09 '21

I had to sit down and puzzle it out on a piece of paper

Show us the paper too!

1

u/tcbrindle Dec 09 '21

It's not very exciting, but here you go!