Weekly Challenge

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

We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!

Submit Feedback
We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.

Challenge #148: Rotating Century Puzzle

Highlighted
Alteryx Community Team
Alteryx Community Team

 

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? 

Highlighted
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
Highlighted
16 - Nebula
16 - Nebula

Fun one.

 

Spoiler
2019-01-14_18-10-01.jpg
Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

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. 

 

Highlighted
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

 

 

Highlighted
8 - Asteroid

My Solution (not the neatest) 

 

Spoiler
challenge_148_solution_SP.JPG
Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Challenge Completed 

Highlighted
10 - Fireball

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

 

Spoiler
148EW.PNG
Highlighted
12 - Quasar

Solution attached.

Highlighted
14 - Magnetar
14 - Magnetar

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