General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2023 Day 11 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

Discussion thread for day 11 of the Advent of Code - https://adventofcode.com/2023/day/11

24 REPLIES 24
Gem
9 - Comet

A nice, tiny break from making iterative macros! 

 

In other news, my efforts/desire to limit the number of tools I slap on the canvas is going the same way as my efforts to reduce the number of cookies I'm consuming this season: not particularly well. I'll pick up on both of these things in the new year 😅

 

Spoiler
Day 11 Workflow.JPG
DaisukeTsuchiya
13 - Pulsar

I post again with solution in yxzp.

 

Spoiler
スクリーンショット 2023-12-11 183021.png
SeanAdams
17 - Castor
17 - Castor

Hello Manhattan distance my old friend!

 

This runs in a few seconds on my machine - so I didn't spend too much time optimizing

 

Spoiler

Solution:

A few things help here:

  1. You only need to keep the galaxies – the # characters – the empty space can be discarded as long as you know the address of the galaxy
  2. By knowing which columns (or Rows) are empty – you can just shuffle everything along
  3. To measure the distance between galaxies – just use Manhattan distance

 

I was a bit lazy – and built 2 macros for the bulk-out, one to move rows, and one to move columns – but it was less brain tax.

SeanAdams_0-1702992926626.png

 

 

The prep macro is a little more complex – it splits out rows; columns to make downstream processing easier

 

SeanAdams_1-1702992926637.png

 

  • The G output is the normal row/col format grid but only for galaxies
  • The R output is blank rows
  • The C output is blank columns
  • And the M output is all cells unaltered for debugging

 

The Bulk-out macros:

SeanAdams_2-1702992926644.png

 

I suspect I could have done this better – but this goes through each row which is empty from the largest to the smallest, and shuffles them downwards.    This way you can iterate from the end.    If I had spent more time on this – there is probably a non-iterative solution, but this runs lightning quick already.

estherb47
15 - Aurora
15 - Aurora

Very much enjoyed this challenge. In years past, the "shortest distance" challenges didn't make sense. This one did, and I'm thrilled that my part 2 runs in .3 seconds!

 

Straight math, no macros, no spatial. I do wonder if you could spatially match points to a line, maybe with a buffer or trade area, and count the number of points to take a spatial approach. Don't have the energy to poke through workflows to see.

 

Spoiler
Using the test data, my initial approach of using the full number, e.g., 100 as the number to add, was slightly high. Decided to subtract one, and it worked. I chalk this up to a lucky guess.
Laurap1228
11 - Bolide

Here is my Day 11 solution

 

Spoiler
AOC11.PNG
Labels