alteryx Community

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.

Challenge #75: Scrabble Word Finder

7 - Meteor

Solution without wildcard
Got to thanks @patrick_digan for the logic for creating all possible letters combination (don't know why I was stuck!)

11 - Bolide

"The challenge this week is to find the best word (from a provided text file) that can be assembled from 7 provided letters"

I went down a different path than what I have seen posted so far.  No macros, finishes in under 2 sec on my laptop, Top 5 for the advanced version verified to @NicoleJohnson's list.  I tried verifying to others but had issues downloading or running the workflows.  For challenges that don't have answers posted, it would be helpful if others could post screenshots of thier results (like @LordNeilLord did), so we can compare our results without having to download and run everyone's workflows/macros. :>

Congrats to @SeanAdams and others on reaching 75!

Spoiler

Eliminate words with more than 7 characters and split to rows.

I think folks got hung up trying to create every word possible from the hand they were dealt.  Since the word had to be in the list provided by @JoeM, I worked on filtering the list to words that contained the necessary tiles and wildcards.

Split Hand to rows, assign point values, if letter not in hand then change value to 0, union workflow.
Join the 2 workflows above to assign points to each letter in the words

Count letters in each word that have 0 points -these are wildcards, if a word contains more than 2 then filter it out.

From the filtered list, now find words that do not contain more than 1 instance of the letters in the hand.

For the records that passed the 2 tests, filter original list, calculate the point values, join original word to workflow, add hand detail, sort, done.

Entire workflow.
With just a couple tweaks, it provides solutions for the other 2 scenarios as well.

Solution for only 1 wildcard.

12 - Quasar

After a couple of false starts, the solution I came up with. Great challenge! Thanks, @JoeM !

In reference to @Ned, it runs in around 1.0 second (0.8 to 1.2 from several runs), pulling from the raw data. And it handles blank

Spoiler

ACE Emeritus

Pretty sure @ned has a nicer solution but have a regex based one running in about 7 seconds (with no pre computes) will cope with blanks but not double letters...

Spoiler

Now to cope with repeated letters

Alteryx Alumni (Retired)

@Philip - that solution is beautiful!  Much simpler than mine and no pre-computing necessary.  And well documented!  Nice!

12 - Quasar

I hadn't considered repeated letters, @jdunkerley79. Had to update to handle them. Thanks for pointing out that need.

Spoiler

ACE Emeritus

I KNEW there was another way to do this. Average of 0.8 seconds for any number of blanks. Now I can sleep again at night!! :)

NJ

Spoiler
1. Filter for <=7 letters
2. Text to Columns for Hand & Replace "blank" with Null
3. Count number of "blanks"
4. Append hand letters to each word, and then append the # of "blanks"
5. Series of nested ReplaceFirst formulas going through each hand letter column and replacing any letters it finds with "", then if there are fewer letters left in the word than the # of blanks, make the remaining letters in the word = ""
6. Filter for only words that have no letters left
7. RegEx_CountMatches to determine how many of each letter is in the chosen word
8. Append Points to the letters in hand
9. Join Points to Transposed count of letters in each position of hand
10. Calculate total points per letter, summarize points per word, sort descending, and voila.
ACE Emeritus

Just for pure obsessiveness got my version down to 1.0s for all 3 hands:

Spoiler
7 - Meteor

Ok, this challenge was a quite hard brain game, but I think I got it... I spent 15 minutes trying to figure out what was wrong in my workflow when I finally saw in a regex I forgot to put the + after \d so it was cutting 10 points value into 1, so I was getting wrong results at the end when it was calculating the points for each word.

Anyway, it was a great challenge, I did not think about generating words before with Alteryx, it is not very easy to do but it is possible and to be honest, I thought I would have spent more time on this, but it took me "only" 2 hours.. ahah

Thanks :)

Spoiler

This is my workflow, I cannot wait to see the solution next week and see if there is a quicker/ faster way to do it :)
ACE Emeritus

This was a really fun one, thanks @Simona for pointing it to me!

Not quite Dunkerley speed, but I got all three hands in the same workflow (and will hopefully work for any hand and any number of blanks!).

Spoiler