Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2022 Day 6 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

Discussion thread for day 6 of the Advent of Code - https://adventofcode.com/2022/day/6

51 REPLIES 51
patrick_digan
17 - Castor
17 - Castor

@AkimasaKajitani neat solve! It reminded me of @AdamR_AYX 's solve from weekly challenge 59 about anagrams. I think you could apply similar logic here:

Spoiler
There are only so many letters in the alphabet to check...
patrick_digan_0-1670333349420.png

 

mmontgomery
11 - Bolide

Iterative macro. the only difference is changing the match string number

Spoiler

mmontgomery_0-1670352927619.pngmmontgomery_1-1670352939811.png

 

 

 

 

estherb47
15 - Aurora
15 - Aurora

Tool golf edition. 2 tools each for parts 1 and 2, with just changing the number of characters to evaluate from 4 to 14. All of the processing can be done with a Generate Rows tool, and then a sample tool for the output.

 

Spoiler
estherb47_0-1670335955140.png

 

Abiramm1
8 - Asteroid

I'll be honest this was a very lazy solution on my end (which I'm blaming on being ill). I initially used a multi row formula for star 1 and not wanting to do the same for star 2 I built a macro that works in essentially the same way

Spoiler
Abiramm1_0-1670337957376.png

 

AkimasaKajitani
17 - Castor
17 - Castor

@estherb47 Cool RegEx solution! I wanted to write like this but I can't write like such a complex one.

DavidP
17 - Castor
17 - Castor

This is the simplest regex I can think of for this. My 1st attempt was clunky with multirow formulas to get the stars. This is better I think.

 

Spoiler
DavidP_0-1670341983250.png

 

Jeff_Neklason
8 - Asteroid

Multi-row madness like many others

Spoiler
Jeff_Neklason_0-1670345604748.png

 

kelsey_kincaid
12 - Quasar

Wish I hadn't gotten such a late start on this one - it was a nice pick-me-up after Day 5! Excited to tool golf this one - I already have several ideas.

 

Spoiler
kelsey_kincaid_0-1670350552832.png

 

SeanAdams
17 - Castor
17 - Castor

Back to a more gentle challenge today - but still a good excuse to learn some regex from some of our friends.

Dirty solution attached - pending refactor.

 

This solution's only redeeming feature is that it is parameterised rather than hard-coded into formulae - so the one answer will work for both parts.

 

Spoiler

SeanAdams_0-1670375662899.png
What this does is to
- generate a different starting pointer for each possible combination.

- Then creates the window text string for that number of characters
- Then splits them into lines (one character per line)
- And checks if the count of characters for that starting position = the distinct count (i.e. if there are duplicates)
- And it picks the row with the lowest starting position which meets the condition.





Yoshiro_Fujimori
15 - Aurora

Setting aside Day 5 problem...

 

Here's my solution for Day 6.

Spoiler
To tackle with Part 2, I changed the workflow.
Thanks to Unique tool, it looks more scaleble.😀

Yoshiro_Fujimori_0-1670395462192.png

 

 

 

Labels