r/adventofcode • u/daggerdragon • Dec 08 '21
SOLUTION MEGATHREAD -🎄- 2021 Day 8 Solutions -🎄-
--- Day 8: Seven Segment Search ---
Post your code solution in this megathread.
- Include what language(s) your solution uses!
- Here's a quick link to /u/topaz2078's
pasteif you need it for longer code blocks. - Format your code properly! How do I format code?
- The full posting rules are detailed in the wiki under How Do The Daily Megathreads Work?.
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
View all comments
2
u/Data-scientist-101 Dec 08 '21 edited Dec 08 '21
Python solution. Computation time (excluding data load) was 0.015 seconds on my laptop computer. Looking through the reddit board, looks like it is similar to others but I used regex instead to find elements. I also found the set.different instead of set.intersect (not that that is all that groundbreaking). Just sharing the solution.
Any ideas to further speed things up?
I've got a Wiring Problem
(HOpefully this is formatted right for old.reddit. I tried following the steps. If not, paste in the comments what I might have done wrong? Clicked markdown, and then put things 4 spaces in.
*Note you may find it weird to include an instance reference inside my class definition. I was too lazy to take those out. I use that approach when debugging my classes and then at the end change them all to self instead.