Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #148: Rotating Century Puzzle

JoeM
Alteryx Alumni (Retired)

 

This week, we got a real puzzler of a puzzle. Before we talk a bit about it, a big shout out and thanks to @patrick_digan@brianaburke002, and @DultonM for sending me this challenge and solution. If anyone here every comes across a great challenge, feel free to message us with your idea! Some of our best challenges come from people like Patrick, Briana, and Dalton who come up against a problem and challenge themselves to solve it in Alteryx.

 

rcp.jpg

Let's try and solve this puzzle using Alteryx! There are 6 Rings  in this puzzle, with 6 numbers in each ring. Notice that you can rotate the rings and get 6 different rows of data. For example, one row could have 22 in Ring 1 (outermost), 7 in Ring 2, 16 in Ring 3,  2 in Ring 4, 18 in Ring 5 and 4 in Ring 6 (innermost). Summing these up, that row has a value of 22+7+16+2+18+4=69. The goal is to rotate the Rings until all 6 rows sum up to 100. For example, you could rotate it to get 15+12+13+26+5+29=100, but the next row would necessarily be 20+14+32+8+34+6=114. Can you rotate the Rings to the correct position? 

JoBen
11 - Bolide

Cheers! This was a lot of fun!

Spoiler
I used an iterative macro to simulate a turning of each circle. Here is what I came up with.

My WorkflowMy WorkflowMy Iterative MacroMy Iterative Macro
jdunkerley79
ACE Emeritus
ACE Emeritus

Fun one.

 

Spoiler
2019-01-14_18-10-01.jpg
CharlieS
17 - Castor
17 - Castor

The idea of an iterative macro got stuck in my head when I started. I was finished by the time I realized how inefficient the solution was. Oh well, it works. 

 

robertlenius
7 - Meteor

Couldn't figure out at first how to automatically get the answer, instead built a macro to mimic the rotations so you can play the game as it was intended.

 

 

Spoiler
Solution.PNGOutput.PNG

 

 

sprodger
8 - Asteroid

My Solution (not the neatest) 

 

Spoiler
challenge_148_solution_SP.JPG
JosephSerpis
17 - Castor
17 - Castor

Challenge Completed 

EW
11 - Bolide

Mine is a bit of a trainwreck, but it seems to get the job done.  RIP, my brain!

 

Spoiler
148EW.PNG
jasperlch
12 - Quasar

Solution attached.

estherb47
15 - Aurora
15 - Aurora

Didn't finish early enough today for the first approach to be a unique solution, so added another :)

 

 

Spoiler
Create all combinations of wheels with Append Fields.

First approach was like many, using MOD to give each arrangement of the rings a unique code. Matching codes mean they're all in the same arrangement (you can add a summarize tool, and there are a total of 6 records per unique code). Check which spokes add up to 100. Count the total records in each unique code, and filter out for the code that appears 6 times in the result. Join back to the data to pull in the values and remove unwanted field.

Second approach, had to be different. Took a little longer. Instead of the matching unique codes, created a string that shows the position of each wheel (e.g., 112233), and then the position of the next set of numbers as you move clockwise (e.g. 223344). Filter out for spokes that add to 100, and join back to original data to bring in the next spoke clockwise for each of those arrangements - join on next position field on those that add to 100 to position field on original data. Filter out for spokes in the second match that add to 100. Still more than 6 records. Rinse and repeat join and filter process. Down to 6 records!! Check that the positions make sense

PosStringNextPosString
112231223342
223342334453
334453445564
445564556615
556615661126
661126112231

Reorder rows, and remove fields we don't need

FUN!!!!
image.png