Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2023 Day 7 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

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

39 REPLIES 39
gawa
15 - Aurora
15 - Aurora

Tool golf version: total 13 tools

Spoiler
 

image.png
Calculate the type by Regex, and convert data into Hexa-decimal, and sort.
image.png

lwolfie
10 - Fireball

That was a fun one!

Gem
9 - Comet

Sorry Camel Santa! It was rough but we got there! 

Spoiler
Day 7.JPG

 

Laurap1228
11 - Bolide

Got to use my favorite tool Tile :)

Spoiler
AOC7.PNG
SeanAdams
17 - Castor
17 - Castor

Day 7 was fun - the solution I came up with is not super pretty, but it works :-)

 

Spoiler
There's not much to say about the recipe here - just used 5 consecutive joins to take care of the jokers; then scored the cards and sorted to find biggest.

Screenshot 2023-12-09 211024.png
CandiceDB
Alteryx
Alteryx

Part One only for now 😊:

 

Spoiler
2023-12-10_09-02-18.png
LiuZhang
9 - Comet
Spoiler
Main workflowMain workflowPart 2 marco to try all combinationPart 2 marco to try all combination

Almost tried some kind explode join, until I realise it is always better to replace J with the same letter.

caitlynmcintyre
9 - Comet

I loved this one

 

Spoiler
7.png

DaisukeTsuchiya
13 - Pulsar

I post again with solution in yxdb.

 

Spoiler
スクリーンショット 2023-12-07 160832.png

Shelbey
Alteryx
Alteryx

Here's my solution.

 

For Part 1, I started by parsing the cards into rows, counted the number of cards per value in each hand, and used a couple of multi-row formula tools to determine if a hand was considered a "Full House" or "Two Pair." I then took the max count of each card per hand and labeled it as "[max count] of a kind" and created another lookup table to assign strength points based on the hand. After that, I created another lookup to assign values to each card and parsed the hands into 5 columns, one for each card with the value of the card from my lookup table. Finally, I sorted the hands first by hand strength in descending order, followed by card 1 in descending, then card 2 in descending, and so on, so that the sort order could be used to assign the final ranking to multiply by the bid.

 

For Part 2, I added a couple of extra formula tools to find the jokers and count how many jokers were in each hand. Then I created a lookup table with all the possible combinations with a joker and what the new hand would look like if the joker took on a different value and changed my card value lookup to include the jokers.

 

Spoiler
Screenshot_challenge_AoC7.png
Labels