Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2020 - BaseA Style (Day 10)

Jean-Balteryx
16 - Nebula
16 - Nebula

Discussion thread for day 10 of the Advent of Code : https://adventofcode.com/2020/day/10

24 REPLIES 24
peter_gb
10 - Fireball

Well that made my head hurt, drew a few diagrams on paper and tried a few bits out in alteryx but no dice for part 2. Keen to see how it was possible!

jdunkerley79
ACE Emeritus
ACE Emeritus

Don't think you can brute force part 2... so a little thinking beforehand.

 

Spoiler
jdunkerley79_0-1607589502451.png


If you want the inner trick for part 2:

Spoiler
A block with steps 113 can have the first 1 removed => so 2 possibilities
A block with steps 1113 can have the first 1, second 1 or both removed => so 4 possibilities
A block with steps 11113 can have first, second, third, first & second, first & third or second & third removed => so 7 possibilities

My data set had no 111113 but think would be 13 possibilities

You can then product these possibilities together to get the total number of possibilities
peter_gb
10 - Fireball

Genius! I got stuck somewhere in the middle of identifying optional steps, and calculating how many valid next steps each individual step had, but got lost as to how to bring all of that together.

AdamR_AYX
Alteryx Alumni (Retired)

I think you can brute force if you reduce the problem on every iteration

 

Here is my iterative macro

 

Spoiler
AdamR_0-1607597123505.png

 

Full solution at https://gitlab.com/adriley/adventofcode2020-alteryx/-/blob/master/day10-part2.yxmd

Adam Riley
https://www.linkedin.com/in/adriley/
OllieClarke
15 - Aurora
15 - Aurora

Struggled with Part 2, and found help on the adventofcode subreddit. Immediately tried to brute force it until I noticed the 'trillions'

Spoiler
workflowworkflowPart 1 iterativePart 1 iterative
AkimasaKajitani
17 - Castor
17 - Castor

Day 10!

 

Part1 was very easy. But Part 2 is.... I couldn't have Iterative approach.
My approach is calculating Combination Numbers. It is similar to @OllieClarke 's approach.

Spoiler

I tried to make all pattern, but it was failed.
And then, I try to calculate combination numbers.

clip.png

As anonymous user #1105310

 

peter_gb
10 - Fireball

Revisited part 2 after some reddit research and the hint from @jdunkerly

-- A nice explainer here https://www.reddit.com/r/adventofcode/comments/ka9pc3/2020_day_10_part_2_suspicious_factorisation/

Spoiler
10.png

Still feels a little shonky though as it wouldn't automatically handle longer chains of 1's up to a 3.
I went through a few different approaches in the disabled container but got lost until seeking help on the maths/logic.

 

patrick_digan
17 - Castor
17 - Castor
Spoiler
I went for a lot of multi-row formula tools...
patrick_digan_0-1607606706852.png

 

cgoodman3
14 - Magnetar
14 - Magnetar

Day 10 part A felt more like a day 1 question. 

 

Spoiler
cgoodman3_0-1607605979439.png


Still working on Part 2, I am currently stuck down a rabbit hole of thinking there is a brute force binary solution to it by trying to generate a series of 1,0s between record 1 and 104 to act as a T|F flag and then to run my multi row. However that's too big, so trying to slim it down by spotting patterns, for example I know my start and end are fixed. and there are repeating 1,1,3 and 1,1,1,3s and know from experience with some of the previous AoCs now looking for patterns.

Finally got there with the second part.

Spoiler

Took the idea of finding the patterns using regexcountmatch and then unwinding the fact that 3,1,1 appears in 3,1,1,1. It did mean to get the right answer I needed to hard code for sole 1,1 which occurs at the start of my workflow.

cgoodman3_1-1607611263159.png

 

 

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
Labels
Top Solution Authors