You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for mis-using the issues section here to share my results, but I couldn't resist 😄
My solution finds all 538 sets in around 50 seconds (with multi-threading on an 8-core CPU).
I'm not using fancy math (I know that's nothing to be proud of) but a few other tricks, which appear to speed things up a little:
Valid five-word sets must use 25 out of 26 characters. Therefore, I select words containing two rare letters
(x and / or q, there are only 315 such words) and use only them as 'seed words'. Then I only have to find four
more words per seed word. Because every valid set must contain either an x and / or a q I can't miss a set.
Initially, I build 26 sets (one for each letter) containing all words that include the particular letter. This
helps in efficiently removing invalid word candidates later on.
The search function works recursively and removes invalid words from the list of candidates for deeper recursion
levels (using the words-by-letter sets mentioned above). This way the search can terminate early once there are no more word candidates left.
The code is pretty simple (~150 lines including comments), however I used kotlin as programming language instead of python.
The text was updated successfully, but these errors were encountered:
Sorry for mis-using the issues section here to share my results, but I couldn't resist 😄
My solution finds all 538 sets in around 50 seconds (with multi-threading on an 8-core CPU).
I'm not using fancy math (I know that's nothing to be proud of) but a few other tricks, which appear to speed things up a little:
Valid five-word sets must use 25 out of 26 characters. Therefore, I select words containing two rare letters
(
x
and / orq
, there are only 315 such words) and use only them as 'seed words'. Then I only have to find fourmore words per seed word. Because every valid set must contain either an
x
and / or aq
I can't miss a set.Initially, I build 26 sets (one for each letter) containing all words that include the particular letter. This
helps in efficiently removing invalid word candidates later on.
The search function works recursively and removes invalid words from the list of candidates for deeper recursion
levels (using the words-by-letter sets mentioned above). This way the search can terminate early once there are no more word candidates left.
The code is pretty simple (~150 lines including comments), however I used kotlin as programming language instead of python.
The text was updated successfully, but these errors were encountered: