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
Galouzis
7 - Meteor

My solution was very similar to that of @jdunkerley79 

 

Spoiler
Galouzis_0-1607607921191.png

 

Greg_Murray
12 - Quasar

Mine is similar to others.

 

Spoiler
Greg_Murray_0-1607609730861.png

 

NedHarding
7 - Meteor

This was much less of a programming problem and more of a maths problem.  And **bleep** all of my UK friends for making me add the s to math!  Anyway - super fun problem.

 

A little hint that isn't obvious at all looking at it at all - there is binary involved again!

 

Spoiler
NedHarding_0-1607612037725.png

 

danilang
19 - Altair
19 - Altair

Non macro solution. Thanks @jdunkerley79 for the hint to part 2.

 

Continuing with my Amp exploration from yesterday, this solution runs slower in the Amp engine(0.8s) vs the original(0.3s).  It probably has to do with the trade off between the overhead in analyzing the workflow for parallel processing and the speed increase gained.  Since there are very few rows in the input data, the overhead vastly outweighs the performance gains.   To investigate this more, I added a generate rows tool to the start to see where potential performance gains begin.  In this very linear workflow, AMP starts to show benefits once the input consists of about 3.5M rows.   

 

Spoiler
w.png

Dan

NicoleJohnson
ACE Emeritus
ACE Emeritus

Couldn't have done this without your hints, @jdunkerley79. I knew there had to be a pattern but was having a hard time spotting it... I did mock it up after reading your suggestion, however, just to prove it out to myself... you're a wizard, my friend.

 

Spoiler
I did create a fabulous little macro that would have solved Part 2... if there weren't trillions of combinations. But thankfully, with James' tip, I was able to eventually figure this one out!

Day10.JPG

Cheers!

NJ

https://github.com/AlteryxNJ/AdventOfCode_2020

balders-ie
7 - Meteor

[deleted]

 

apols for duplicating my post, need to make sure I'm on the right account, see below for my answer.

Balders
11 - Bolide

I got a nice little use out of the tile tool there and [edit] some janky maths that doesn't hold for higher numbers now I've read the reddit thread. 😅

 

Spoiler
Workflow: 
Screenshot 2020-12-10 173936.png
Calc for the multiplier [wouldn't work for n=6]

2020-12-10_17-39-10.png

 

 

Balders
11 - Bolide

I've now supersimplified it with a conditional Tribonacci

Spoiler

Screenshot 2020-12-10 184600.png



IF [Row-3:data] + 3 >= [data] THEN MAX([Row-3:ans],1) ELSE 0 ENDIF +
IF [Row-2:data] + 3 >= [data] THEN [Row-2:ans] ELSE 0 ENDIF +
IF [Row-1:data] + 3 >= [data] THEN [Row-1:ans] ELSE 0 ENDIF

 

T_Willins
14 - Magnetar
14 - Magnetar

This took me back to math theory and patterns from college.  What was hanging me up on part b is I was trying to apply the pattern below "1113" (count ones = 3).  At and above that it is:

 

Spoiler
(3*Pow(2,[Count]-3))+1   Below 3, [Count]=2 is 2 and [Count] 1 is 1

AOC20.10.jpg

 

patrick_digan
17 - Castor
17 - Castor

@Balders Nice use of the tile tool, I could have replaced 2 multi rows with 1 tile in my workflow.

Labels
Top Solution Authors