Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2021 Day 8 (BaseA Style)

jdunkerley79
ACE Emeritus
ACE Emeritus

1436371257-joseph-michael-luminosity-5-1024x640.jpg

Discussion thread for day 8 of the Advent of Code - https://adventofcode.com/2021/day/8

21 REPLIES 21
cgoodman3
14 - Magnetar
14 - Magnetar
Spoiler
Mine is so ugly that it's good that it's zoomed all the way out!

cgoodman3_0-1638998215414.png


Eventually got there with part 2. Like others have said it was a case of working out what fitted inside other numbers. So doing 1 compared to 7 gets you the top part of the number, then if you compare the strings with length = 5 you know that only a 3 contains a 1 (thanks @NicoleJohnson for that tip). If you subtract a 9 from an 8 you get the bottom left position which helps identify the 5 etc...

I also used transpose and 2x summarise tools to convert the strings into alphabetical order, which probably wasn't required, but it made it easier to check combinations, so I stuck with it. 

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
dsmdavid
11 - Bolide
Spoiler
Went through a rabbit hole. Glad to see I was not the only one...
dsmdavid_0-1639008200706.png
I went with the approach that it would be easier to identify segments than numbers. Segment b is in 6 numbers, segment e in 4... segment c in combination with b in 4... etc. If I were to start again, I would not pick this approach...
dsmdavid_1-1639008246309.png

 

 

estherb47
15 - Aurora
15 - Aurora

Yikes! Translating the way my brain solved this problem was ugly, so I'm not posting my solution. I'm not even sure I can post my thought process, but will try when I have some time.

 

DataG8
8 - Asteroid

Like everyone else said, it just took me too long to understand the problem, then to formulate the solution. As others said, glad this is zoomed out. I'm sure there could be a 25% reduction in tools.

Spoiler
Advent Day 8 DataG8 Solution.JPG
starkey
7 - Meteor

This one was a mind-bender for me... told myself I can just be content with part 1 and move on with my life but I couldn't stop thinking about haha. The breakthrough moment for me to be able to solve for part 2 was once I realized I could determine the digit using if then formulas to test the length and overlap with the digits discovered in part 1. Turned out to be a pretty successful round of golf 😁

starkey_0-1639109018682.png

 

danilang
19 - Altair
19 - Altair

It's an ugly one today. No tool golf winner for me

Spoiler
Since all possible digits were provided for each line, the key to solving part 2 was to use the possible segments per digit and then build a workflow to match this logic

Segment that shows up 9 times is F
Segment that shows up 4 times is E
Segment that shows up 6 times is B
Segment that isn't F in the 1 is C
Segment that isn't BCF in the 4 is D
Segment that isn't EFBCD and shows up 8 times is A
Segment that isn't EFBCD and shows up 7 times is G

Then join back to the input to  calculate the true values

danilang_0-1639229421515.pngDan

danilang
19 - Altair
19 - Altair

Hi @starkey 

 

Welcome to the club!  Can you put your images in spoiler tags so as not to give clues?

 

Thanks

 

Dan 

SeanAdams
17 - Castor
17 - Castor

WOW - not only is this quite a formula, but my brain is cooking just trying to figure out how you did this @grossal 

SeanAdams
17 - Castor
17 - Castor

this is clever @danilang - I never thought to count the frequency of the segments.

I went about this using intersection / commonality.

 

For example - if you're a 6 segment and you do NOT have all the same segments as a 1, then I know that you are the number 6.   This does cheat a little though 'cause the instructions specifically say that you should map wires to segments (like you did)

 

SeanAdams
17 - Castor
17 - Castor

So - this one took a few hours - and a few wrong turns.

Eventually got a solution by ignoring the segment -> wire mapping, and just looking at the numbers.

I think this is similar to what @NicoleJohnson and @cgoodman3 did?

 

Spoiler

Translation Logic:
- we can identify the translation for digits 1,4,7,8 just by length

6 segment numbers:
- 6 is the only one without full overlap with number 1
- 9 is then the 6 digit number that shares full overlap with number 4
- 0 is then the remaining 6 digit number
- now we have numbers 0,1,4,6,7,8,9 - only 2,3,5 to go

5 digit numbers:
- 3 is the only 5 digit number with full overlap vs. number 1
- The digit 2 has 2 differences vs. the number 4; where the digit 5 only has 1 difference



To do this Intersection / overlap of the numbers by segment - built a simple macro.    You feed in your comparison number (e.g. the number 1) and then the ones you want to compare to - and it tells you how many are missing / matching

SeanAdams_0-1639287607596.png

 


The main workflow then looks like this:
- First Prep and clean the data (including sorting)

SeanAdams_1-1639287652917.png


Then match the numbers based on overlap / intersection with other numbers:

SeanAdams_2-1639287715654.png

 

The whole thing is a bit big if you look at it in entirety.

SeanAdams_3-1639287755598.png

 



Labels
Top Solution Authors