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 #200: Sudoku Solver

Highlighted
Alteryx
Alteryx

A solution to last week's challenge can be found here

 

Challenge 200 represents another milestone (and badge!) on the trek up Mt. Everest: the arrival at Camp 4.  To celebrate officially entering the Death Zone, we're serving up a challenge created by puzzler extraordinaire @TerryT

 

Sudoku is a popular puzzle that requires you to the cells in a 9×9 grid with digits so that each row, each column, and each of the nine 3×3 boxes (shown with heavier lines) contains all the digits from 1 to 9 exactly once. Each puzzle is encoded as an 81 character string.

 

This challenge has three solution levels:

 

BEGINNER:
Using the Beginner and Intermediate Start File, parse the puzzle by separating rows nine characters at a time. The columns and boxes then line up accordingly where a ‘0’ represents an empty cell.

 

INTERMEDIATE:
Solve the puzzle provided in the Beginner and Intermediate Start File.

 

ADVANCED:
Solve the Sudoku puzzle from the Wikipedia article (Wikipedia Puzzle Start File).

 

mt everest camp.gif

Welcome to the Death Zone (Source: GIPHY)

Highlighted
12 - Quasar

Solved Beginner Level

Spoiler

solved.jpg

1st tokenize.jpgsecond tokenize.jpg

  

Highlighted
14 - Magnetar
14 - Magnetar

Quickly solving to get that 200th challenge done. Beginner is done. Will post intermediate/advanced when I have more time to think on it

 


EDIT: Here we go. I didn't want to use a macro this time around. All macroed out from Advent of Code (which I'm still plugging through!)

Beginner:

Spoiler
EstherB47_1-1580173934585.png

 

Intermediate:

🙂

 

Spoiler
EstherB47_2-1580174091906.png
Highlighted
8 - Asteroid

Using one of my favorite tools--(Regex). First break down the 81 character line into 9 character chucks; rename the columns; transpose it; break it into 9 fields; rename the fields; and that is it.

 

Spoiler
2020-01-27_11-36-45.jpg
Highlighted
The Force

Beginner completed. Need some more time on intermediate and advanced.

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Decided to solve it step by step - so this is my solution for the beginner part.

 

Spoiler
200_1.png

 For the intermediate, I used a macro - and advanced will require some additional work.

Spoiler
28-01-_2020_11-45-58.png
Highlighted
8 - Asteroid

My Beginner solution - the others will follow

 

Spoiler
JamesCameron_0-1580151689385.png
Highlighted
15 - Aurora

My favorite, the R Tool, and another favorite, "Google to Kaggle to cut/paste and minimal tweaks."

 

Solves the Advanced also, but as noted, credit goes to Kaggle.

 

No spoiler picture other than the R tool.  Would be fun to see it running as iterative macros, though (or via optimization).

 

Highlighted
7 - Meteor
Spoiler
ChristinaFPE_0-1580152253402.png

Here's the Beginner portion solved. I need a bit more time to figure out the Intermediate and Advanced.

Highlighted
Alteryx
Alteryx

Beginner and Intermediate done. The Advanced is going to take some serious work...

 

Spoiler
2020-01-27_10-56-12.png
Because the puzzle could be solved by simple elimination, I was able to get away without iterating at all. If there were multiple candidates after the first elimination I would have gone to an iterative macro. 
I haven't looked at the advanced puzzle yet, but if it is even relatively hard, it could be really nasty. Most of the solutions I've seen use backtracking which would be fun to try in Alteryx although I'm not sure how without using Python.