General Discussions

Discuss a wide range of topics! Questions about the Alteryx Platform should be directed to the appropriate Product discussion forum.

Advent of Code 2021 Day 17 (BaseA Style)

16 - Nebula
16 - Nebula

Discussion thread for day 17 of the Advent of Code -

17 - Castor
17 - Castor

My solution was very similar to @NicoleJohnson - ran in 7.2 sec on my laptop with AMP turned on.


Rather than trying to find every combination of Vx and Vy - the fact that that they are independant means that you can narrow the search space substantially by:
- Search for all values of Vx that get you into the target zone
- Do the same for Vy
- Only now look at combinations - much smaller search space.



10 - Fireball

thanks @dsmdavid for the quick way. 


overall the idea is similar as i refer to them😅.

but once i get the answer, and i realise macro will save more time. 

As brute force may have lot of waste calculation, Mass Steps, Mass Initial X and Initial Y.
like target X and initial x are 200. it only need to calculate for 1 step, but due to brute force. it calculate 100x useless calculation.
like target Y is -155, it need to stop if Y is pass that location. and same, brute force, it calculate lots of useless calculation.

with iteration macro. both situation can avoid and run the workflow faster.